EmEditor
Professional 4.0 creates functionally-rich macros using
JavaScript or VBScript, allowing you to define most operations.
Not only can you define a macro which records keystrokes that
you use and reference repeatedly, but you can also write your
own macros that can manipulate other applications, Windows-based
files, or network functionalities. The macros are based on the
Windows Scripting Host (WSH) engine, so you can use all of the
powerful, robust objects available under the Windows Scripting
Host.
EmEditor Professional 4.0 features two newly added
configurations: JavaScript for EmEditor and VBScript for
EmEditor. When you open a macro file in EmEditor, keywords, such
as macro objects, properties, or methods, are automatically
highlighted. For assistance on certain keywords, move the cursor
over the keyword and select Search for Keyword, or press F1.
When an error occurs during the execution of a macro, a dialog
box will appear showing the content of the error. If you click
on the Edit button, you can jump to the location where the error
occurred.
EmEditor uses JavaScript or VBScript for its macro language, so
those who are familiar with HTML or Windows scripting will be
able to write macros with little difficulty. For those
unfamiliar with scripting languages, EmEditor can record
keystrokes that can then be saved in a macro file, which can
easily be loaded in different situations. With the use of
JavaScript or VBScript, you can also troubleshoot your code
easily. For example, in JavaScript, you can use the following
statement to troubleshoot errors:
try { ... } catch(e) { ... }
When an error occurs, such as a file opening failure, the
try-catch statement allows the script to continue executing,
instead of forcing it to terminate.
EmEditor macros are based on the WSH engine, so you can use
various Windows-based objects and Component Object Model (COM)
components. For example, you can perform regular expression
searches using the RegExp object, manipulate files using the
FileSystemObject object, create a short-cut, manipulate the
Windows Registry using the WshShell object, or work with
networking functions using the WshNetwork object. Additionally,
you can create and execute a macro that utilizes an external
application that supports automation using COM components (such
as Word and Excel) to copy a document created in EmEditor, then
paste into, and print it from the external application.
EmEditor macros are modules designed independently of EmEditor
executable and are implemented as a Dynamic Link Library (DLL)
file. To conserve system resources, the DLL is loaded only
during the macro execution. |