Can I auto run iMacros script when Firefox start?

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
my6360
Posts: 1
Joined: Thu Feb 23, 2012 1:42 pm

Can I auto run iMacros script when Firefox start?

Post by my6360 » Thu Feb 23, 2012 1:51 pm

I build a iMacros script, I hope it will be auto run after Firefox start, is possible? I don't want to click the iMacros script.
skippyto
Posts: 108
Joined: Wed Aug 20, 2008 8:14 am

Re: Can I auto run iMacros script when Firefox start?

Post by skippyto » Mon Feb 27, 2012 5:04 pm

Hello !

You can do that by opening a HTLM page using javascript to delay the launch of your iMacros' script (as iMacros is not often ready as soon as your browser is opened).

Example of a command line to launch Firefox on the HTML page you want :
"C:\Programs\FF8\Firefox\firefox.exe" -p MyFirefoxProfileDedicatedToThisMacro -no-remote http://localhost/myHTMLpage.htm /Prefetch:1

Example for the HTML page's source :

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>Launch-iMacro: Javascript to launch iMacros in Firefox</title>
		<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
		<meta content="General" name="rating">
		<meta content="ALL" name="ROBOTS">
	</head>
	<body onload="setTimeout('launchMacro()',1000);">
		<script type="text/javascript">
			function launchMacro()
			{
				try
				{
					setTimeout("document.location = 'imacros://run/?m=MyMacro.js';",5000) ;
				} catch (e)
				{
					// Close the browser if a problem occurs
					document.location = "imacros://run/?m=close.js";
				}
			}
		</script>
		<div align="center">
			<h1>Launch-iMacro</h1>
		<br>
		<hr/>
			Some explaination about the script<br>
		<br/>
		<br/>
		<hr/>
		</div>
	</body>
</html>
Post Reply