Code Snippets

 

Use the Code Snippet function to create reusable macro code. Create common routines or functions that may be easily inserted into other macro scripts. 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 context menu. (Or click on Edit > Add to Snippets from the Script Editor menu.)

 

 

 

 

A small dialog box opens prompting to name the snippet. The name helps to later identify what the snippet does. Click OK to save the name and add it to the list of existing snippets.

 

 

Inserting a Snippet into the Script

Highlight the code snippet needed and click on one of the insert buttons to insert the snippet into the script in the location required.

 

 

Deleting a Snippet

If a code snippet is no longer needed, highlight the snippet and press the Delete button on the keyboard. A prompt appears to verify that the snippet should be deleted. Press Yes to delete or No to cancel.

 

 

Editing a Snippet

There is not a direct method for editing an existing code snippet. The current method consists of the following four steps.

 

1.Insert the snippet into a macro script.

2.Edit the changes directly in the macro script.

3.Delete the snippet from the list.

4.Save the script changes as a new snippet with the same name as the one deleted.