Sponsored Content
Top Forums Shell Programming and Scripting Help with Shell Script opening and closing a program Post 302838067 by Don Cragun on Sunday 28th of July 2013 10:58:59 PM
Old 07-28-2013
Going to the web page you posted, there is absolutely nothing that looks like what you're doing. The following suggestions are there:
Quote:
Command Line Support

You can start imacros (or Javascript scripts) inside of Firefox via the command line:

Code:
 "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"  imacros://run/?m=...

or
Code:
 "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"  imacros://run/?code=...

for instance:

Code:
 "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"  imacros://run/?m=Demo-FillForm.iim

Note: When you first start Firefox via the command line the iMacros extension is not immediately active . It takes a few seconds for Firefox to activate it. So the imacros://run/ command does get intercepted already but not yet processed by iMacros and a blank page appears.

Solution: Make sure that Firefox is already running. If you start Firefox a second time, Firefox will direct this new command automatically to the already running instance. Now iMacros can "see" the imacros://run/ URL and start the macro.

You can use a batch file like this:

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"   imacros://run/?m=Demo-FillForm.iim

Note: If you use the batch start command, Firefox must be the default browser.

More information: Our users created several useful forum posts about the command line feature:

Automating task each day
Problem with starting imacros
Starting a script from DOS cmd line?
Batch File: Load Firefox, Run Macro(s), Close
Schedule macros with the "My Weekly Browsing Schedule" add-on (slides 30-31)
Alternative solution: If you need more control over Firefox you can use the iMacros Scripting Interface that comes with the iMacros Enterprise Edition. This method gives you complete control over Firefox and Internet Explorer. For example, you can return error codes or extracted data from the browser to your program or script.

For Mac OS X users: to start a macro from the OS X command line or as a scheduled job, you can use the following command syntax (Thanks to Christopher A. for this hint):
Code:
/usr/bin/open /Applications/Firefox.app "imacros://run/?m=Demo-FillForm.iim"

What operating system are you running? The comment I marked above in red seems to directly address your issue. The code I marked in blue is their suggestion for how to handle the issue on Windows (which looks exactly like what I suggested), and the code I marked in green is their suggestion for how to handle the issue on Mac OS X.

What operating system are you using? What is your "default" browser? What type of shell is /bin/sh on your system (an old Bourne shell as on Solaris 10 systems, a Korn shell as on many other UNIX systems, a bash shell as on many Linux systems, or something else)?

Do you have iMacros Enterprise Edition?

Note that showing us your MODIFIED script and the errors produced by your unmodified script makes it harder for you to get help. Having us look at error messages that don't match your code makes it impossible for us to diagnose your problem and makes us wonder if we can trust anything you show us.
 

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Requests for Opening/Closing Threads

Please send an email to the administrator(s) of the board with thead ID and forum for any thread that is closed that you want open (or open that you want closed). All requested considered. Our apologies if sometimes threads are closed early. If this happens, please email :) Nobody is perfect... (0 Replies)
Discussion started by: Neo
0 Replies

2. Post Here to Contact Site Administrators and Moderators

Opening and closing threads

Hi all, Just thought I'd mention something I've noticed since joining this forum :) Would it be a good idea to close threads once the initial question that was posted has been answered? I notice a few posts where people go on and on and as soon as you post a reply to one question they... (2 Replies)
Discussion started by: _Spare_Ribs_
2 Replies

3. Shell Programming and Scripting

Getting Following problem when opening shell script (Very Urgent)

Hi All, Actually when i am trying to open my shell script file 1.sh then i am getting the following error. > vi 1.sh "/var/tmp/ExdNaarK" No space left on device Can anybody tell me that how to rectify it. It is very urgent. Because i am not able to do any work due to the above error. ... (1 Reply)
Discussion started by: sunitachoudhury
1 Replies

4. Shell Programming and Scripting

closing a telnet session on error, in a shell script

I am using a shell script to telnet into a remote unix server and execute certain commands. But if any command being executed remotely, throws an error, the script just hangs. And the telnet session does not get closed. I want to be able to close the session and complete the script execution in... (1 Reply)
Discussion started by: farahzaiba
1 Replies

5. Shell Programming and Scripting

Finding opening and closing braces

I am reading a cpp file thru shell script . There are many fuctions inside the cpp file eg pvvd_fncn_name1 { ..... something } pvvd_fncn_name2 { ..... something } what I require is a method to find the first opening brace and the coresponding last brace and search... (2 Replies)
Discussion started by: ultimatix
2 Replies

6. OS X (Apple)

Opening and Closing Shares via ssh

Might anyone have an idea on how to mount an xserve share via ssh, then close the share connection? (3 Replies)
Discussion started by: unimachead
3 Replies

7. Shell Programming and Scripting

Help with opening another file from within a shell script

Hi, I am trying to open a file that I have created from withn a shell script and cannot seem to get it working. Does anyone have any ideas? Thanks. (2 Replies)
Discussion started by: tdsrogers
2 Replies

8. Shell Programming and Scripting

Opening Child Shell & Executing a script in the same context

Hi, Is the below possible (SHELL = tcsh)? -- I want to write an 'alias' something like this - alias set_my_work "setenv SOME_VAR;tcsh -i;source work_script.cshrc" The intention is to run this alias and enter a child shell, at the same time ensuring that the work_script.cshrc is source-ed.... (0 Replies)
Discussion started by: mishra.a.c
0 Replies

9. Shell Programming and Scripting

Print a closing XML tag shell script

I have a shell script that does everything I need it to do. But, when I was testing it I realized it doesn't print the closing XML tag.... Does anyone know how to incorporate printing the XML tag with my script? I am using AWK any help would be appreciated. (4 Replies)
Discussion started by: risarose87
4 Replies

10. Shell Programming and Scripting

Script Works But Need It to Exit Upon Closing Program

Running Xubuntu 16.04 with shell version "GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)," I have a working script that consistently renames a Chrome window: #!/bin/sh while sleep 1; do xdotool search --name chrome 2>/dev/null | while read id; do xdotool set_window --name... (21 Replies)
Discussion started by: jakefish
21 Replies
All times are GMT -4. The time now is 08:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy