mmoalem

execute imacros bookmark or adapt script

5 posts in this topic

hi there all - learning the ropes here...

i would like to execute an imacros script in a chrome browser every couple of hours - i can run the browser, in the right URL, I can close the browser but i am not sure how to run the imacros script... the imacros script use xpath to press a button so maybe I can do this directly with autoit or maybe i can run the imacros script from autoit... any ideas?

thank you

michel

Share this post


Link to post
Share on other sites



if by imacro you mean the browser iMacros extension, then you can launch a macro at browser launch, by using the command line as such:

Run('"' & $sFirefoxFullPathToExe & '" imacros://run/?m=' & $sMacroFile)

note: i'm using Firefox, but i imagine Chrome is no different. if $sFirefoxFullPathToExe or $sMacroFile mentioned in my example are not clear, do feel free to ask.

 

Share this post


Link to post
Share on other sites

hi and thanks for the reply... have to admit the syntax is not clear to me :( but also i would like to delay the imacros execution for the page to load fully so will have to run chrome, sleep (5000) and than run the imacros script (test.iim)...

so this is what i put together but it doesnt work...

RUN('"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 21" -new http:///www.yahoo.com')

Sleep (5000)

RUN("imacros://run/?m=' & $test.iim")

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

look at your macro - if you recorded it, then you'll find that the first thing it does is to navigate to the page you want to automate. you can add it manually, too. look at the iMacro help.

the imacros://run/?m= switch does not stand on its own - it's a parameter passed to the browser, like the --profile in your script. so you need only one Run(), no Sleep().

EDIT: and your 2nd Run() is wrong. drop the single quote, the & and the $ signs, and the spaces between.

 

Edited by orbs

Share this post


Link to post
Share on other sites

Hi again...

this is what I tried now

RUN('"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 21" -new http://www.yahoo.com imacros://run/?m=test.iim')

it doesnt work

I think I read somewhere that Imacros takes a little time to initialize hence the reason I wanted to add a 5 second sleep time...

any other way to instruct the browser to use a bookmark (the imacros scripts can run as a bookmark)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now