back to Jitbit Blog home About this blog

Macro Recorder: another trigger example

by Alex Yumashev · Dec 20 2007
Another example of "triggering" events with our Macro Recorder software and the IF statement. The following script makes Macro Recorder wait until Notepad window has appeared.

LABEL : start
IF WINDOW EXISTS : *notepad*
GOTO : end
ENDIF
DELAY : 2000
GOTO : start
LABEL : end
MESSAGE BOX : Notepad window found, exiting..

As you can see, this macro checks every 2 seconds, and if it finds a window with the "notepad" text in its caption, the macro exits. Simply save the above text as a plain-text file with a ".mcr" extension and load it into the Macro Recorder to test how it works.