Script Editor

 

Use the Script Editor to build a macro or to edit a macro already created. The Script Editor is divided into three main sections, the Commands, the Macro Script and the Debugging tabs. Select the commands to insert into the Macro Script. The Macro Script is written so that the top line in the script is the first command that plays back in the macro.

 

üNote: More than one macro may be open in the editor at the same time. Tabs at the bottom of the window allow for navigation between open macro scripts. Either click on the tab to open or press Ctrl Alt Left Arrow or Ctrl Alt Right Arrow to move between the tabs.

 

 

Macro Express Explorer > Create a new macro or edit an existing macro

 

 

The Script tab contains the list of commands and the macro script. Additional information about the macro can be viewed or edited in the Activations, Variables, Miscellaneous, Scope, Security and Notes tabs.

 

 


 

 

Macro Icon and Nickname

Located near the top of the editor window is the Macro Nickname field and a macro icon. In the example below, the icon is a red number two.

 

 

 

Macro Icon

The icon (in the example above, a blue number one) is displayed to the left of the macro nickname. Click on the icon to open the Select an Icon window. Click on the browse button to open a folder with a number of icon options. Or navigate to another location on the hard drive to find other icons on the computer. If an icon was not selected at the time the macro was created, the default Macro Express icon is displayed.

 

Macro Nickname

The nickname is used to help remember the function of the macro. If a nickname was entered when assigning the macro activation, the nickname is displayed as shown in the image above. The nickname may be changed in this field if desired.

 

 


 

 

Command View

Select from the drop down menu which command view to display.

 

All Commands

This option displays all of the commands that may be used in Macro Express. To insert a command into the script, scroll until finding the command category wanted. Click on the category to expand the list and display all of the commands available for that category.

 

Double click on the command to display a window to define what the command should do. Then click OK on the new window to insert this command into the Macro Script.

 

Double clicking on some of the commands that do not require any definition inserts the command directly into the Macro Script, without an intermediary window.

 

Favorite Commands

This option displays just the commands that are assigned as favorites, making it easier to find the most frequently used commands. From the Script Editor menu click on Options > Customize Favorites to assign the favorites.

 

Code Snippets

Use the Code Snippets function to create snippets of a macro script, such as routines for use in multiple macros. Save the code snippet to later insert into a macro at any time. Select Code Snippets from the drop down list as shown below to view, create or insert snippets.

 

 

 

 

Creating a Snippet

Select (highlight) one or more lines of a macro script in the Script Editor. Right mouse click on the highlighted lines and left click on Add to Snippets from the menu that opens. (Or click on Edit > Add to Snippets from the menu.)

 

Inserting a Snippet into the Script

Highlight the Code Snippet to use and click on one of the green insert buttons to insert the snippet into the script. The Macro Script Navigation topic below defines where in the script the snippet will be placed.

 

 

Search for command

Use this function to quickly locate a specific command within the Commands list. Type the first few letters of the command to find it. To look for the Password Protection command, enter "pa" without the quotes. This highlights the Password Protection command within the list of commands. Typing "pau" without the quotes moves the highlight to the Pause command.

 

 


 

 

Macro Script

This area lists each of the commands that the macro will perform. The macro plays back sequentially through the list beginning with the top item. Edit any of the commands in the list by double clicking on the line of the script to be edited.

 

There is also a right mouse click context menu available for the items in the Macro Script. Highlight the line or lines of the script needed and then right mouse click. A context menu appears with a variety of options, also available through the Scripting Editor menus.

 

One item unique to the context menu is the Edit Macro option. Right mouse click on a Macro Run command in the script and select the Edit Macro option. The contents of the macro from the Macro Run command are displayed in a separate tab in the Script Editor.

 

 

Debugging Tabs

The Debugging Tabs located near the bottom of the Editor window provide information when attempting to debug a macro. Also click on Debug > View Variable Values or press the F5 key to see a display of all variables used in the macro and the values saved to those variables. These are displayed when running the macro in Test Mode.

 

Messages

Any syntax errors or other problems with the macro are displayed in the Messages tab when saving a macro. This tab will alert you to potential problems with the macro script, such as having a Repeat Start command without a matching Repeat End, or an If command without a matching End If.

 

 

 

 

Breakpoints

This tab displays any breakpoints that were defined in the macro for debugging purposes. The line in the script and the command with the breakpoint are displayed.

 

 

 

 


 

 

Macro Script Navigation

This section describes the functionality of the buttons available to help build and modify the macro script.

 

 

Button

Function

Description

 

Insert Command Before Selected 

Inserts the macro command selected from the Commands list above or before the command that is highlighted in the Macro Script edit box. If a script item is not highlighted in the edit box, the macro command is placed as the first or uppermost item in the script.

 

 Insert Command After Selected  

Inserts the macro command selected from the Commands list below or after the script item that is highlighted in the Macro Script edit box. If a script item is not highlighted in the edit box, the macro command is placed below or after the first or uppermost item in the script.

 

Add Command to End of Script

Inserts the macro command selected from the Commands list as the last item in the script, below all other items.

 

Disable Command 

Highlight a line in the Macro Script and then click on this button. It disables the highlighted line in the script, so that it does run during macro playback. A red line is drawn through the disabled script, for a quick visual acknowledgment.

 

Enable Command

Highlighting a line in the Macro Script that is disabled displays this symbol. Click on the button to enable the line in the script to allow the command to run during macro playback.

 

Direct Editor 

Switch from the Script Editor view to the Direct Editor. 

 

Move Command Up  

Moves the highlighted command up one spot in the Macro Script, ahead of other script items already in place. Each click moves the command up one space in the script. Also highlight several consecutive lines in the script and move them all at the same time.

 

Move Command Down

Moves the highlighted command down one spot in the edit box, beneath the other script items already in place.  Each click moves the command down one space in the script. Also highlight several consecutive lines in the script and move them all at the same time.

 

Duplicate Macro Command

Highlight one or more lines of the macro script and click on the Duplicate button. This adds another copy of the command line or lines to the script. This is essentially a one step method for copy and paste. Or press CTRL D to duplicate the highlighted command or commands.

 

Insert Comments

Highlight a line in the macro script and click on the Insert Comments button or press Ctrl Alt C to open a Comments edit box. Type any comments about the line in the script into this box and click OK. The comments are inserted next to the command listed in the script.

 

 

Keyboard Shortcuts
These are the Keyboard Shortcuts available in the Script Editor.

 

 

Keystroke

Action

Alt+Right Arrow

Move focus to the macro script area

Alt+Left Arrow

Move focus to the All Commands/Favorite Commands/Code Snippets panel

Alt+Down Arrow

Move the text cursor to the Search for command box

Ctrl+Alt+Left Arrow

Move to the previous macro tab

Ctrl+Alt+Right Arrow

Move to the next macro tab