If you want true automation, you can't be clicking buttons in a browser to make it run. To solve this problem, I had to use an entire roll of duct tape and come up with some out of the box shit.
Javascript
iMacros lacks logic. This is one of it's real weaknesses and why nobody worth a pinch of salt would consider it a true programming language. Need if statements? Go elsewhere. Fortunately the creators realized this and did something very smart ... allowing iMacros to play nicely with javascript. While I'm no JS fan, it is the right tool for the job because it specializes in browser based programming (whereas php, asp, python & most of the rest are server side languages, they won't run inside a browser). Since iMacros also runs in your browser, they really are a good match for each other.
There are 2 main uses for javascript for my flavor of automation.
1> Page interraction ... need for iMacros to scroll down in your browser so that ajax can load up the comment section?
Javascript
iMacros lacks logic. This is one of it's real weaknesses and why nobody worth a pinch of salt would consider it a true programming language. Need if statements? Go elsewhere. Fortunately the creators realized this and did something very smart ... allowing iMacros to play nicely with javascript. While I'm no JS fan, it is the right tool for the job because it specializes in browser based programming (whereas php, asp, python & most of the rest are server side languages, they won't run inside a browser). Since iMacros also runs in your browser, they really are a good match for each other.
There are 2 main uses for javascript for my flavor of automation.
1> Page interraction ... need for iMacros to scroll down in your browser so that ajax can load up the comment section?
URL GOTO=java$cript:w1ndow.$crollBy(0,1000)
Yep, that'll work
2> closing down a browser ... so this is pretty imporant in the bigger picture. Once our scripts are compelte working, we need to return to a pristine environment so that the next time an iMacro is ran, the system can launch from stable ground (everything closed). In my projects, I use winautomation to open a browser and run an imacro (through a .js file). Winautomaion needs firefox to close before it considers that step "complete" and moves on. Problematic without a little js love. Here's how I do this.
2> closing down a browser ... so this is pretty imporant in the bigger picture. Once our scripts are compelte working, we need to return to a pristine environment so that the next time an iMacro is ran, the system can launch from stable ground (everything closed). In my projects, I use winautomation to open a browser and run an imacro (through a .js file). Winautomaion needs firefox to close before it considers that step "complete" and moves on. Problematic without a little js love. Here's how I do this.
function SetAndPlay(macro) {
iimSet("foo", "bar");
return iimPlay(macro);
}
iret = SetAndPlay("wickedfire.iim");
w1ndow.close();
I left the iimSet function in there so you can see you can pass variables to and from javascript directly from this file. I personally don't, that's what the mothership is for; It's there if you need it though.
The last 2 lines are important ... SetAndPlay opens a specific iMacro and runs it .... w1ndow.clo$e(); (convert 1 -> i and $ -> s) closes the browser so winautomation can continue to the next record.
Winautomation
So the only software this tutorial uses that has a cost attached is winautomation. It's fairly cheap and if you pick up a copy, you'll find all kinds of excuses to use it. Winautomation doesn't use "code", so you'll have to live with a screenshot of what's going on in the executable.
This winautomation scripting logic is simple. It calls home to the mothership looking for work_to_do and if it equals anything except "sleep", I use command line to launch firefox & start running wickedfire.js ... which in turn runs wickedfire.iim then closes the browser. Winautomation sleeps for a minute then repeats the process.
To make this system completely work, iMacro code in my 2nd post must be saved as "wickedfire.iim" & you'll need to add ...
The last 2 lines are important ... SetAndPlay opens a specific iMacro and runs it .... w1ndow.clo$e(); (convert 1 -> i and $ -> s) closes the browser so winautomation can continue to the next record.
Winautomation
So the only software this tutorial uses that has a cost attached is winautomation. It's fairly cheap and if you pick up a copy, you'll find all kinds of excuses to use it. Winautomation doesn't use "code", so you'll have to live with a screenshot of what's going on in the executable.
This winautomation scripting logic is simple. It calls home to the mothership looking for work_to_do and if it equals anything except "sleep", I use command line to launch firefox & start running wickedfire.js ... which in turn runs wickedfire.iim then closes the browser. Winautomation sleeps for a minute then repeats the process.
To make this system completely work, iMacro code in my 2nd post must be saved as "wickedfire.iim" & you'll need to add ...
if ($_GET['work_to_do'] == 1) {
$q = mysql_query("SELECT id FROM imacros_table WHERE complete = 0 ORDER BY id ASC") ;
if (mysql_numrows($q) > 0) { exit ('start work') ; }
else { exit ('sleep') ; }
}