Running two loops at once

Is it possible to run a sequence of events in two different web browsers simultaneously? I try, and for some reason it can only do one at a time.

I think you’re asking can you get a single script to do both tasks at once. The answer to that is no - AppleScripts are not threaded.

No, I mean if you have two separate scripts (in separate windows), I’m trying to get them both to run at the same time.

If they don’t have to be coordinated (step for step) why not just start the second from the first? Save both as applications, figure out how long it takes the second to start, delay the first while it waits and go.

The problem I see is if your scripts are telling two other applications to do something, each tell will bring that application to the front, and they both can’t be there so one will wait for the other briefly. I’ve never seen anything like your proposal in this forum.

Hi,

I don’t think you can synchronize the scripts to run at the same time. You could use the Finder to simulate it. If you have 2 script apps:

activate
display dialog “hi”

and

activate
display dialog “bye”

then you could open them with the Finder with:

set app1 to “Macintosh HD:Users:kel:Desktop:App1” as alias
set app2 to “Macintosh HD:Users:kel:Desktop:App2” as alias
tell application “Finder”
open {app1, app2}
end tell

Note that many other things could go wrong and this needs to be tested. Also add error checking to all your scripts.

gl,