Read this
http://wiki.imacros.net/iimPlay%28%29
In the
iMacros for Firefox built-in
Javascript Scripting Interface you have the option to add the
relative path to the iimPlay command. Example: If your Javascript (JS) file is in the main directory, but the macros are in the "test1" subdirectory, then please use iimPlay ("test1/yourmacro"). (Note: This feature will be added to the general Scripting Interface in the near future, too.)
So your JS code will look like:
iimPlay ("test1/yourmacro")
For example to extract a value from a website and then execute your code if the returned value is greater than 1:
iret = iimPlay("test1/retrievevalue.iim");
if ( iimGetLastExtract() > 1 )
{iret = iimPlay("test1/yourmacro.iim");
}
Also to have your macro open a new tab and then switch to it and open a site:
TAB OPEN
TAB T=2
URL GOTO=http://www.NewTabSite.com