Creating Tool or Service Script
With scripting possibilities coming withing 1.50 release it is possible to automate a lot of routine task in advanced way (non advanced is using of macros, also available with 1.50).
Supported Scripting Engines
These resources can be used as starting point for learning scripting languages:
It is also possible to write scripts in other languages if they there is Active Script engine available
If you think about implementing something with scripting, you have two choices:
- Tool script - script that executes and behaves as normal tool. It runs, does the work and exits.
- Service script or, another name, Script Plugin - this is a rich version of scripts, similar to real binary plugins, which starts automatically, live in the background and react on such user interaction as a keystroke, menu or toolbar selection.
Scripting in HippoEDIT is not very different to any scripting implementation by other applications and very similar to scripts you can run in a web browser (like Internet Explorer, Firefox, Chrome etc). Any script for browser or other application which does not use internal objects exposed by the application itself (like window in browsers) should also run in HippoEDIT. All tricks with objects, inheritance, prototypes, accessing via this should also work.
There are some specialties, which implements HippoEDIT and which make it a little bit different (from functional but not conceptual side) from other scripting hosts (applications which allow scripting of them):
- Of course, this is its own set of named objects exposed to script (as Application)
- Support of including and importing of other script files (this is rather rare feature)
- Emulating of WSH (Window Scripting Host) objects, to make it easier migration from WSH to HippoEDIT or even to run WSH scripts directly in HippoEDIT. Emulation works well on basic feature level, but some stuff is not supported
- Events concept. This one of most powerful HippoEDIT features, which is similar to dynamic events in web browsers
- Support of native dialog descriptions and data bindings
- “Scoped” serialization support (global, workspace, project, session)
But independently to reach scripting feature set, HippoEDIT provides, writing of scripts is easy. Here is your first hello world application:
var version_string = "I am running HippoEDIT " + Application.version; alert("Hello World!\r\n" + version_string );