Commands & Syntax > Commands > Macro Engine >

www.MacroToolworks.com

Macro execution: KEYS / FREE TEXT + COMMANDS - < keys > ... [Free]

 

Macro execution: KEYS / FREE TEXT + COMMANDS
<keys>
Available in: Free edition

This command changes how the macro is played back. The part of the macro that follows after this command is played back so that whole macro text (keys) are executed. Use this command to enable playback of all macro text (keys) if "cmds" command was previously used.

 

 

Example (Macro Steps):

 

1

<#> <#> This macro shows how to use 'cmds' and 'keys' commands

2

Macro execution: ONLY COMMANDS

3

Jump TARGET "lbl_Again"

4

Message SHOW "" : "Starting Notepad ..." (other parameters: x = 100, y = 100, Window title = Message, Buttons = None, Timeout (seconds) = , Always on top = ).

5

Run APPLICATION "notepad.exe" (other parameters: Parameters = , Folder path = , Window state = Normal). Macro execution waits for application to finish up to "0" seconds.

6

WAIT FOR Object = "WIN", Event = "OPEN", Parameter = "[* - Notepad|Notepad|#0|#119]", Timeout (seconds) = "15", Exact = "0"

7

Message CLOSE

8

Macro execution: KEYS / FREE TEXT + COMMANDS

9

Hello, \ \ this macro just demonstrates 'cmds/keys' commands. \

10

Macro execution: ONLY COMMANDS

11

Variable SET "vAgain=YES/NO", Message text="Do you want to run this macro again ?"

12

IF STRING vAgain==YES

13

Jump TO "lbl_Again"

14

ENDIF

Example (Plain Text):

 

<#> This macro shows how to use 'cmds' and 'keys' commands

<cmds>

 

<label>("lbl_Again")

<msg>(100,100,"Starting Notepad ...","Message",0)

<execappex>("notepad.exe","","",0,0)

<waitfor>("WIN","OPEN","[* - Notepad|Notepad|#0|#119]",15,0)

<msgoff>

 

<keys>Hello,

 

this macro just demonstrates 'cmds/keys' commands.

<cmds>

 

<varset>("vAgain=YES/NO","Do you want to run this macro again ?")

<if_str>("vAgain==YES")

   <goto>("lbl_Again")

<endif>