1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

imacros question: Can i execute external file?

Discussion in 'General Scripting Chat' started by muxmkt, Feb 28, 2012.

  1. muxmkt

    muxmkt Power Member

    Joined:
    May 24, 2011
    Messages:
    543
    Likes Received:
    132
    Hey guys, sorry about lots of imacros threads lately, but im tyring to learn :)

    Now i need to know if i can execute an external file and parameter when running my macro.

    What i want to do is lets say execute "c:/folder/file.exe -dosomething"

    there is anyway possible?


    thanks :)
     
  2. flist

    flist Registered Member

    Joined:
    Jan 14, 2012
    Messages:
    72
    Likes Received:
    17
    If it's the free version of iMacros for Firefox, I don't think you can. However, you could set up a batch file and have it run the macros, as well as the external file with command.
     
  3. ziplack

    ziplack Senior Member

    Joined:
    Feb 18, 2010
    Messages:
    1,193
    Likes Received:
    603
    Location:
    BHW
    here u go

    example :

    Code:
     start /B "C:\Program Files\Mozilla Firefox\firefox.exe"  http://www.google.com
     ping 127.1.1.1 (or pause or sleep ... it is just to cause a small delay)
     start /B "C:\Program Files\Mozilla Firefox\firefox.exe"   http://run.imacros.net/?m=Demo-FillForm.iim
    http://wiki.imacros.net/iMacros_for_Firefox#Command_Line_Support
     
  4. flist

    flist Registered Member

    Joined:
    Jan 14, 2012
    Messages:
    72
    Likes Received:
    17
    You can also use:

    Code:
    timeout /t 15
    The number is the number of seconds to wait before running the next part of the script.

    Also, if you use locally hosted scripts in a batch file, you need to add an extra % sign if there are any spaces or anything in the locally stored bookmark to ensure that they are processed properly.

    So,

    Code:
    "C:\Program Files (x86)\Mozilla Firefox 9.0\firefox.exe" imacros://run/?m=Name%20File%5CNameofScript.iim
    becomes

    Code:
    "C:\Program Files (x86)\Mozilla Firefox 9.0\firefox.exe" imacros://run/?m=Name%%20File%%5CNameofScript.iim
    if you are trying to run it as part of a batch file.