Macro language changes

PhraseExpander 5 comes with a completely redesigned execution engine with a lot of new capabilities.

In this documents, we describe the major changes you'll find in the macro language for the creation of your templates.

Variables

Manual Inputs are now called fill-in variables. They have a lighter syntax which makes the document easier to read. And they have a name, so, once defined, they can be quickly reused in the document.

Convert a block of text to a variable (or template) for reuse

Select a piece of text and convert it to a variable or a new template and reuse it in your templates

Nest and compose macros and variables

Use Macros inside other macros and variables.

Reference variables from other templates

You can define variables in a template and recall them from another template. Thus you can define a set of frequently used variables once and reuse them in your other templates. 

Adapt the variable casing

Once you have defined a variable, you can easily change its casing by adding a modifier to the variable tag.

Enabling/disabling a single variable

You cannot enable/disable a single variable but you can group variables together inside a Section macro that can be toggled.

Dynamic templates

Using variables and macros you can create templates that adapt their contents based on the selection you are making.

Flow control macros allow you to define how the template will change based on certain conditions.

If: the if macro allows you to create a different flow and changes the text generated by the template based on the value of a user input or any expression.

Section: the section macro allows you to group a block of text (including macros and variables) and toggle it by clicking on a checkbox

Insert template and Id

Reusing the contents of a template in another template is much easier now, thanks to the Id which uniquely identifies a template.

Comments

Comments are no longer macros but have their own syntax. You can comment any piece of information by surrounding it with the comment markers 

{~ This is a comment and it will not be inserted in the generated document ~}

You can easily comment or uncomment a block of text by clicking on the comment or uncomment buttons.

Breaking changes

PhraseExpander 5 has been redesigned from the ground up to make it faster and more powerful and, although we did our best to preserve all the functionalities present in v.4, we had to make some important changes.

Most of them are automatically accommodated during the migration of your data from v.4 to v.5. Others would require some manual changes or slight adjustment to your phrases

Extract & Send Macro: this macro is no longer available in v.5

Clipboard Action macro: this macro is no longer available in v.5

Clipboard Set macro: this macro is no longer available in v.5

Variables cannot contain interactive macros: variables can contain only non-interactive macros (interactive macros are the ones that interrupt the execution flow, like wait, run application, send keystrokes).

SetPhrase macro → Set macro: the SetPhrase macro is used to assign the contents of a phrase. In PhraseExpander 5 the macro has been renamed to set. The set macro needs the ID to assign the contents of a template, so it needs to be recreated manually. Counters are no longer supported in the macro. You can create counters with variables and the Update variable macro and then save the final value into a template with the set macro.

Insert phrase → Insert template: in PhraseExpander 5 templates are inserted by using an Id, and you can no longer insert multiple phrases (selecting them by abbreviation or description). Glossaries and groups can be selected by Description only. The result of an Insert template macro will always be a single item (or none). If more than one item matches the criteria, PhraseExpander will return the first item. If you are currently using the Insert template macro to return multiple items, you'll need to check and update your templates manually.
The inserted template will be automatically converted to plain text (the ability to include formatted templates will be reintroduced shortly after the final release).

Input Form macro: the macro has been removed as all the user input fields are automatically displayed in a single form.

Note Manual Input: the Note Manual Input has been removed in PhraseExpander 5 because each fill-in variable can have a comment. When migrating from v.4 to v.5 Notes Manual Inputs will be converted to comments and attached to the following fill-in variable.

Autofill with selection in Manual Inputs: the default content of a manual input cannot be populated based on a text selection when invoked by shortcut. This has nothing to do with the shortcuts used to add a phrase into PhraseExpander, which will continue to work.

Single manual inputs: when a phrase contains manual inputs (now called fill-in variables) they are always displayed together in a single form. There's no longer the option to show them separately (in v.4 they were shown separately in the Standard Edition or the Professional edition if no Input Form macro was present).

Run macro inside File Open/Save dialogs: If a template containing a run macro is executed in the file textbox inside the Open/Save file dialog, it will no longer be expanded into text but it will perform the standard action of launching the application.

Still need help? Contact Us Contact Us