r/applescript • u/agrajag63 • Oct 30 '24
out-of-sequence execution in script?
I use an AppleScript (running directly from the Script Editor application) to control some apparatus-- it is a legacy system running macOS 10.9. The script talks to a couple of applications and loops until the "done" condition from one of the applications is reached. After that is code to tell an app to download the data.
Very occasionally the script will seem to execute lines from the script out of sequence. For example today it seemed to execute the "data download" section of code before the "done" condition had been reached.
Is it a thing that applescript can execute lines of a script out of order? If so, is there any way to strictly enforce execution order?
View all comments
Show parent comment
2
u/agrajag63 Oct 31 '24
Sorry it's not clearer. The "currentpass" is an integer parameter read from the "Data Controller" application - running from 1 at the start up to the preset limit (here 1000) based on the triggers sent.
Seem to have veered off-topic a bit in wondering if out of order execution is possible in the script as it is run. It's true I could try to calculate a better approximate delay before looking for the can to finish, but that might just mask the problem. It seems tricky as the issue arises very infrequently so hard to debug.
Thanks for the suggestions and scrutiny though.