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
1
u/agrajag63 Oct 31 '24
The problem seems to happen after the "repeat until" loop in the middle, which is intended to wait until the data collection is done. Each data scan runs 20 to 60 seconds, so there is the short delay in the loop so it doesn't loop too many times but does detect the end condition pretty quickly