Next macro must wait if another one is currently running

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
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
Stevieoo
Posts: 4
Joined: Tue Oct 26, 2010 7:43 am

Next macro must wait if another one is currently running

Post by Stevieoo » Mon Nov 08, 2010 8:47 am

Hi!

I running my macros timebased via the windows7 sheduler.

Several macros are started at different times.
It is possible that two macros started at the same time or very shortly after the first one.

Problem:
If one macro is currently running and the next macro is starting with the sheduler, so the first macros is aborted and the second one runs. So i have in result one macro failed.

Can i prevent that?

How do I tell the program to wait until the other one is finished before start the next macro ?

Greets
Stevieoo
Posts: 4
Joined: Tue Oct 26, 2010 7:43 am

Re: Next macro must wait if another one is currently running

Post by Stevieoo » Tue Nov 16, 2010 11:27 pm

any idea ?
jbwocky
Posts: 24
Joined: Fri Aug 28, 2009 7:36 am

Re: Next macro must wait if another one is currently running

Post by jbwocky » Wed Nov 17, 2010 5:52 pm

Are you using simple macros or javascript as well?

One solution is to have each macro create a file when it starts. While that file exists, or while it contains the sentence "macro running", the current one can not start.
Let me know if this makes sense, or if you need more details.
CodeLab
Posts: 100
Joined: Sun Dec 27, 2009 5:50 pm

Re: Next macro must wait if another one is currently running

Post by CodeLab » Thu Nov 18, 2010 8:07 am

Hi...

If I Reckon Correctly...
Main Problem Is,
If Two Macros Starts At The Same Time, Then One Of Them Fails...

Solution Suggested By @jbwocky Could Work...

Another Possible Solution I Could Think Of, Is To Create Another Firefox Profile..
And Use iimInit Switches Such That,
Macro1 Runs With Firefox Profile1 And
Macro2 Runs With Firefox Profile2

Here Is The Link That Could Help...
http://kb.mozillazine.org/Creating_a_ne ... on_Windows
http://wiki.imacros.net/Firefox_Sample_Profile.ini
Stevieoo
Posts: 4
Joined: Tue Oct 26, 2010 7:43 am

Re: Next macro must wait if another one is currently running

Post by Stevieoo » Thu Nov 18, 2010 11:42 am

Hi!

@jbwocky
Thanks for your attempt to help.
This can be realized via batch files, i´ll try that.

@CodeLab
With firefox profiles i worked in the past, and i crashed my main profile :oops:

I will try the batch file idea at first.

Thx guys
Stevieoo
Posts: 4
Joined: Tue Oct 26, 2010 7:43 am

Re: Next macro must wait if another one is currently running

Post by Stevieoo » Sat Nov 20, 2010 1:43 pm

Hi!

I have now written a working batch file that fit my needs.
THX @ All

Code: Select all

@echo off

:check
echo CHECK IF ACTIVE
if exist temp.run goto loop

:start
echo temp > temp.run 
rem "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -remote openURL(http://run.imacros.net?m=test.js)
del temp.run
goto end

:loop
echo PROCESS ACTIVE - WAIT 60 SECONDS
ping -n 60 127.0.0.1 > NUL
goto check

:end
exit

Greets
Post Reply