Reuse Manual Input |
Top Previous Next |
If you want to request a piece of information to the user and reuse it in your phrase many times (e.g. ask for a name by using a Manual Input and reuse it in the entire document), PhraseExpander can manage that.
To reuse Manual Input using variables You can store the result of a Manual Input in a variable using the Set Variable macro, and recall it using the Get Variable macro, as shown in the example below.
{#inputForm -[title=Shipping notification]#}Dear {#varSet {#input -[desc=Name]#} -[name=Username]#}, Thanks for your order. We are shipping the product to {#var Username#} at the following address. {#input -[desc=Address][display=textArea][lines=4]#}
Best regards, Matt
The {#input -[desc=Name]#} macro is stored in a variable called Name, which is then retrieved using the {#var Name#} macro.
NOTE: if you want to reuse the same manual input in many phrases, you can use the Set Phrase Contents macro.
To reuse Manual Input without using variables If you want to reuse the data entered in the Manual Input in multiple places in the phrase, just copy the same Manual Input macro in all the places where you want the text to be inserted. For this to work, an Input Form macro must be placed at the beginning of the phrase.
{#inputForm -[title=Shipping notification]#}Dear {#input -[desc=Name]#}, Thanks for your order. We are shipping the product to {#input -[desc=Name]#}at the following address. {#input -[desc=Address][display=textArea][lines=4]#}
Best regards, Matt
The {#input -[desc=Name]#} macro is repeated in two different places in the macro, but you'll be asked to provide the user name just once. |