Call us at +1 586 62 ELLIE Office Opened
sales@elliecomputing.com

Newsletter
Keep up to date with the new features added to ECMerge, the new products that we release and receive special offers! (approx. once a month):
HTML version
Text version
Testimonials

NewsRSS 2.0
August 25th, 2008: We just released ECMerge 2.1.81. This version fixes several bugs.
               

User macro-commands

 

 

In Ellié Computing Merge, we decided to integrate a full ECMAScript engine to let you make your own macro-commands.

Defining macros

The "User" macro commands are ECMAScript functions. These functions are listed in the "macros" global Array object. Thus, adding a function to this array makes it available as a macro command in the Edit / Macros menu (it appears after next Reload macro files, Alt-F11 by default).

In order to make this possible, Ellié Computing Merge loads and execute macro scripts at start-up (and also at Reload macro files time).

When a macro script is executed, it simply declares some macro as available in this way:

macros["macro_name"] = function ( ) {
    // body of the macro
    alert ("I was executed at " + Date());
}
macros["macro_name"].label = "Beautiful Macro name";
macros["macro_name"].shortcut = "Ctrl+Shift+0";
macros["macro_name"].toolbar_name = "My macros";
macros["macro_name"].toolbar_rank = 1;
macros["macro_name"].icon_url = script_url.compose("../myicon.png");

You can save the above sample in the 'macros' directory of Ellié Computing Merge as 'sample_macro.js', then execute Reload macro files. The "macro_name" macro appears in the macros menu, executing it will display the famous web-browser alert box with "I was executed at [current date and time]" text inside.

Accessing macros from Graphical User Interface

Macros are accessible from:

  • the Edit / Macros menu
  • the toolbars: if you set a property "toolbar_name" and/or "toolbar_rank" for a macro (as in the sample above), the macro will be accessible from an additional macro toolbar
    • one macro toolbar is created for each distinct "toolbar_name"
    • the toolbar_rank is used to sort macros in ascending (left to right) order in a toolbar
    • if 'icon_url' points to a local file, this image is used else a default icon is provided. We generally use 16x16 24bits PNG with transparency as icons.
  • the key bindings / shortcuts:
    • you can specify a default shortcut for any macro by defining its "shortcut" property (as in the sample above)
    • macros are visible in the "Key Bindings" panel of the Application Options, you can therefore set modify their shortcut as for any other command

 

Select your language English Français
© Ellié Computing 2004-2008 - Legal information - Resources