Exit iMacros-Browser from the running macro

Share your tips, tricks and favorite iMacros macros, scripts and applications for web automation in general here.
Post Reply
Posts: 4
Joined: Thu Nov 23, 2006 10:05 am

Exit iMacros-Browser from the running macro

Post by bruenni » Wed Dec 20, 2006 11:32 am


I start a macro by a perl-script with

Code: Select all

C:\Programme\iMacros>imacros.exe -noexit -macro standardmacro
In the standardmacro is a line for an errormacro to take a screenshot of the actual sight of the website, when an error occurs:

Code: Select all

SET !ERRORMACRO screenshot
I´m searching for a way to exit the iMacros-session from within the running standardmacro, when no error occurs, to avoid iMacro from running till the timeout of my perl-script eventuates (caused by the needed "-noexit").

Exiting it by iim.Exit from the perl-script doesn´t work, because i loose the last sight of the actual website for a potential run of an errormacro for a screenshot.

So, it must be similar to iim.Exit - only inside the macro - not at the prompt.

User avatar
Tech Support
Posts: 4947
Joined: Tue Sep 20, 2005 7:25 pm

Post by Tech Support » Wed Dec 20, 2006 6:42 pm


If you are running this from a Perl script you can make use of the scripting interface commands rather than using the command line. In this way you will have much greater flexibility in how you handle instances of iMacros.

For example based on the return code of an iMacros call you could run your screenshot macro.

This would avoid needing to use -noexit and hence your problem with waiting for the timeout.

Daniel Kerr
iOpus Support
Post Reply