Page 1 of 1

How To close browser upon completion of imacro

Posted: Fri Nov 29, 2019 7:01 am
by Goldclownfish
I've seen several topics asking how to close the browser after a macro runs. Here is a method to close Palemoon upon completion of macro. :shock:
The reason for the -546 is in order to start Palemoon from a batch file an loop the macro multiple times its necessary to use a negative number. You also need to disable(uncheck) "warn me when closing multiple tabs" in preferences-->Tabs

Code: Select all

SET !LOOP -546
SET MyLoop {{!LOOP}}
ADD MYLoop 547
SET CLOSE EVAL("var s='{{MyLoop}}'; var x; if(s=='0'){x='W';} else{x='';}; x;")
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY" CHAR="{{CLOSE}}" MODIFIERS="ctrl,shift"

Windows 10 Palemoon 28.5.0 iMacros 8.9.7