Working with macros

Top  Previous  Next

Macros let you perform more advanced operations than just inserting text (macros are only supported in Phrases glossaries).

You can also use them to create complex scripts where multiple operations are chained together (e.g. open an application, wait for it to load, insert text into it, close it).

 

PhraseExpander can highlight macros syntax to make viewing and editing macros easier.

Macro Syntax

Each macro has a standard syntax.

macro-syntax

 

1.Beginning: all macros begin with the {# key sequence

2.Name of the macro: indicates the action the macro will perform

3.Argument: the argument of the macro

4.Options: each macro could contain a number of options. Each option is represented in the format [optionname=value]. The beginning of the options is marked by the -[ sequence

5.Ending: each macro is closed by the #} sequence

 

To create a new macro

1.In the Phrase details pane, click on the Macro button macro

PhraseExpander opens the macro popup window

2.Click on the type of macro you want to create
The new macro creation dialog is opened

3.Make any changes and click OK to confirm
The code of the new macro will be inserted into the phrase

 

To edit the active macro

1.Double-click on the macro name
PhraseExpander opens the macro editing window

2.Make any changes and click OK to confirm
The selected macro will be updated to reflect the changes

 

To display a list of macros in the phrase and edit them

1.In the Phrase details pane, select the Macro button macro
PhraseExpander opens the macro editing window

2.Click on Edit macro in phrase (this will be visible only if at least one macro is present)

3.Select the macro you want to edit from the popup menu

4.Make any changes and click OK to confirm
The selected macro will be updated to reflect the changes

 

Nesting macros

The same phrase can contain multiple macros, and they can be nested inside one another to create powerful scripts.

For example, you can use the following macro: a Manual Input macro is nested in a toUpper macro, to ask for user input and automatically convert it to uppercase.

 

{#toUpper {#input -[desc=Customer name]#}#}