Set Phrase Contents

Top  Previous  Next

Available in PhraseExpander Professional

This macro updates or creates a new phrase in PhraseExpander. You can use this to store simple text or the results of a Manual Input, and reuse it by executing the Insert phrase macro.

You can also use the Set Phrase Contents macro to create counters that are incremented every time the macro is executed.

 

With the Set Phrase Contents macro, the set value is stored in a phrase, so it's available in multiple phrases and executions.

 

To store a piece of data in a phrase

1.In the Phrase details pane, select the text that you want to reuse (this can be plain text or even a Manual Input).

2.Click on the Macro button macro

PhraseExpander opens the macro popup window

3.Click on Set Phrase Contents...
PhraseExpander will open the Set Phrase Contents macro window with the selected text already inserted in the contents

The Set Phrase Contents macro lets you store some text in a phrase for later use.

The Set Phrase Contents macro lets you store some text in a phrase for later use.

 

You can customize the Set Phrase Contents macro through the following options:

1.Text: the variable will contain some text

2.Contents: the text that will be stored in the phrase

3.Counter: if checked, it creates a counter

4.Counter options:
Start at: the initial value for the counter
Increment: the value will be incremented by this amount every time the macro is executed
Use fixed number of digits: sets the minimum number of digits the final result must have

5.Description: the explicit description of the phrase whose content you want to change. If the phrase doesn't exist, a new one will be created. The description is case insensitive, so gender, Gender, GENDER will all work

6.Location: the name of glossary or group where the phrase will be saved. If you have defined more than 1 group or glossary with the same name, PhraseExpander will pick the one with the highest priority.

7.Insert text into the document: if checked, the text that is saved into the phrase will be inserted into the generated document

 

Syntax

 

{#phraseSet contents -[hint][dest][counter][start][inc][digits][hide]#}

 

contents: the data to be stored in the phrase. If the content is empty, the phrase will be removed

[hint]: the description of the phrase whose contents will be set. If the phrase does not exist, a new one will be created

[dest]: the name of the glossary or group that contains the phrase

[counter]: if set to 1, PhraseExpander will treat the phrase as a counter

[start]: if the variable is not set, PhraseExpander will assign the start value to it (default value: 1)

[inc]: the value contained in the phrase will be incremented by inc every time the macro is executed (default value: 1)

[digits]: the minimum number of digits displayed (zeros will be prepended if needed)

[hide]: if set to 1, the text will not be inserted into the phrase when executed (default value: 0)

 

Example 1: storing the result of a Manual Input

Phrase:

{#phraseSet {#input [Male]He::[Female]She -[desc=Gender][display=list]#} -[hint=Gender][dest=data]#}

 

Result:

the content of the phrase with description Gender is set with the value of the Manual Input

 

 

Example 2: creating a counter

Phrase:

{#phraseSet -[hint=Last Image][dest=data][counter=1][digits=3]#}

 

Result:

the phrase with description Last Image is incremented (or it is created and its content is set to 1 if the phrase doesn't exist). Every time the macro is executed, the content of the phrase will be incremented. If the value has less than 3 digits, zeros will be pre-pended. For example, 2 will be represented as 002.