MACRO - < run >() ... [Pro]
Run MACRO <run>("Macro","Parameters","Time to wait") Available in: Professional edition
|
Runs other macro (specified by name). It is possible to pass the called macro a parameter and it is also possible to receive a return data from the called macro. If the called macro returns some data then the data are available through "_vMacroResult" system variable right after the command finishes execution.
Note below parameters specific to "Clipboard macros".
|
#
|
Parameter name
|
Parameter description
|
1
|
Macro
|
Name or ID (showing in the "general" tab in macro definition view) of the macro to run.
|
2
|
Parameters
|
Parameter that will be passed to the remote macro. The called macro can retrieve the parameter data from "_vMacroParameter" system variable.
- If the macro called is "Clipboard macro" with a text (including rich text) content then it is possible to replace text in the "Clipboard macro" by some other text specified in the parameter. The syntax is:
replace_what:EXISTING_TEXT;replace_by:NEW_TEXT;
Example: replace_what:rep01;replace_by:%vCustomerName%;replace_what:rep02;replace_by:%vHelpPhrase%;replace_what:rep03;replace_by:%vInputNeeded%; Where EXISTING_TEXT is a text in the "Clipboard macro" and NEW_TEXT is a new text (can be also a variable) that will replace the EXISTING_TEXT before the "Clipboard macro" is pasted. There can be multiple replace_what;replace_by; pairs in the parameter. It is recommended to use a simple text such as "rep01" (rather than something like "%rep_01%") as a text to replace since different rich text formats in "Clipboard macro" encodes special characters (such as %, _, -, +, etc.) differently and replacement could fail. This feature can be used to create nicely formatted templates of documents and e-mails that can be quickly and easily filled with appropriate data.
- If the macro called is "Clipboard macro" then it is possible to specify here "load_only" parameter which will cause that the "Clipboard macro" is just copied to clipboard but not pasted to an application.
|
3
|
Time to wait
|
Time in milliseconds to wait before next command is executed. If this parameter is empty then a default wait time is used.
|
|
|
Example (Macro Steps):
|
1
|
<#> <#> This example shows how to call a macro called "ToUpper" using command.
|
2
|
<#> <#> We pass parameter "lowercase string" that the "ToUpper"
|
3
|
<#> <#> macro converts to uper case and passes back as a result.
|
4
|
Macro execution: ONLY COMMANDS
|
5
|
Run MACRO ToUpper, Parameters = lowercase string,Time to wait =
|
6
|
Message SHOW "Information" : "%_vMacroResult%" (other parameters: x = -100, y = -100, Window title = And the result is, Buttons = OK, Timeout (seconds) = 0, Always on top = ).
|
|
Example (Plain Text):
<#> This example shows how to call a macro called "ToUpper" using <run> command.
<#> We pass parameter "lowercase string" that the "ToUpper"
<#> macro converts to uper case and passes back as a result.
<#>
<cmds>
<run>("ToUpper","lowercase string")
<msg>(-100,-100,"%_vMacroResult%","And the result is",1,0,0)