Forcing script to restart periodically

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
nirius
Posts: 11
Joined: Thu Mar 04, 2010 5:14 pm

Forcing script to restart periodically

Post by nirius » Sat Mar 06, 2010 4:30 am

I would like to force my script to restart periodically, as the macro inexplicably hangs at random points in its execution. I don't mind if it means restarting the controlling javascript file, or if there's simply a way to force-restart the call to the macro if no return value is received within a certain time.

Has anyone implemented this already?

Cheers

Nirius
Daniel, Tech Support
Posts: 1483
Joined: Tue Jan 26, 2010 11:35 am

Re: Forcing script to restart periodically

Post by Daniel, Tech Support » Tue Mar 09, 2010 8:43 pm

Hi,

Well, I would suggest debugging the script in the first place, but otherwise you could've created another script that periodically kills the first one and starts it again.

Best regards,
Daniel, iOpus Support
nirius
Posts: 11
Joined: Thu Mar 04, 2010 5:14 pm

Re: Forcing script to restart periodically

Post by nirius » Wed Mar 10, 2010 4:07 am

Hi Daniel,

Thanks for your reply. Please could you provide me with the command / code that would enable one script to kill another?

The script in question is very simple:

SET !TIMEOUT_MACRO 300
TAB T=1
ONDIALOG POS=1 BUTTON=CLOSE
URL GOTO=http://www.amazon.com
WAIT SECONDS=5
TAB T=1
TAB CLOSEALLOTHERS

It sometimes hangs on the URL line, other times on the TAB CLOSEALLOTHERS line. I have other instances of firefox running on the same machine executing the same script in a loop. As this is a particularly simple script, and there is no pattern to the hang-point, could there a conflict where two firefox instances are reading the actual .iim file?

Cheers,

Nirius
Daniel, Tech Support
Posts: 1483
Joined: Tue Jan 26, 2010 11:35 am

Re: Forcing script to restart periodically

Post by Daniel, Tech Support » Wed Mar 10, 2010 9:36 am

Hello Nirius,

I am sorry, I didn't mean there is an iMacros command that would kill a script. You would need to use a programming language for that.
On the second thought, you could use another approach: decrease the !TIMEOUT / !TIMEOUT_TAG in your macro, so that it doesn't hang, but end sooner and schedule it to run with Windows Scheduler or an equivalent every x minutes.
Daniel, iOpus Support
nirius
Posts: 11
Joined: Thu Mar 04, 2010 5:14 pm

Re: Forcing script to restart periodically

Post by nirius » Thu Mar 11, 2010 1:37 am

Thanks Daniel,

I am currently calling the iim script from a javascript file. Do you know the command I could use from javascript to force-kill the iimPlay() function after a certain period of time has elapsed?

Cheers

Nirius
Daniel, Tech Support
Posts: 1483
Joined: Tue Jan 26, 2010 11:35 am

Re: Forcing script to restart periodically

Post by Daniel, Tech Support » Fri Mar 19, 2010 7:17 pm

Hi,

I don't think there is one you can if you're running your Javascript in Firefox as then your permissions are quite limited. What about the other approach I suggested?
Daniel, iOpus Support
Post Reply