Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Jim Coyne
Kilo Patron
Part of the Tips 'N Tricks" series.

 

Here's a feature that is probably not used often enough - Syntax Editor Macros.  These Macros give you the ability to insert little bits of templated script into your current script.

 

There's not much information in the online docs about the Macros, but that's because there's not that much to say.  Basically, you can save small snippets of code you use often and with a few keystrokes, you can then have those snippets added to the script field you are editing.

 

There are 6 OOB Macros that are installed in your instance.  You can add more by clicking on the "Syntax Editor Macros" Module under the "System Definition" Application menu and then clicking on the "New" button.

 

find_real_file.png

 

find_real_file.png

 

To have the script text added to your code, simply type in the name of the Macro and then press the "Tab" key.  This will replace the name you've typed in with the Text from the Macro.  There's a "special" built-in macro that is not actually part of the records in the table.  Type the word "help" and then press the "Tab" key.  The word "help" is replaced by a list of all the records in the Editor Macro table, including any new ones you've added:

 

find_real_file.png

 

find_real_file.png 

 

The Comments from the record are also displayed so you know what text that particular macro would insert.  So to add a "for loop" to some code you are working on, just type "for+Tab" and you'll end up with...

 

find_real_file.png

...added to your code.  Nice shortcut and you don't have to remember the syntax (just the macro name 🤓).

 

NOTE: The names of the Macros are case sensitive.

8 Comments