Commands & Syntax > Commands > Macro File >

Macro execution: ONLY COMMANDS - < cmds > ... [Free]

www.perfectkeyboard.com

 

Macro execution: ONLY COMMANDS
<cmds>
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 only commands are executed while other macro text (keys) is ignored. This prevents macro from inserting unwanted keys (for example new lines used just to format macro) during playback. To enable playback of all macro text (keys) use "keys" command.

 

 

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>