Time limit exceeded

Is there a Preference setting to allow a loop that uses AppleScript to use an extended amount of time before erring? I am recently getting the following error when going through a loop after about 80 iterations.

You can set the amount in seconds in Panorama X Preferences > Advanced > Timeout for running procedures.

Here is the Help page that covers this.

I believe I also covered this in one of the “Short Programming Topics” video sessions earlier this year.

As looping through a set of records from top to bottom is not an endless loop, I was hoping that that setting would not be the answer as that applies to all procedures in all databases.

As my situation is an AppleScript issue, and while I’ve not had to alter this setting before, I do see that there is a ScriptTimeOut command. Will that take precedence if I don’t change the global preference? I’d really like to not have all of my procedures have a long time out. (I do miss the Command-Period exit.)

Please read the short help page I linked to, it shows how to set a custom time limit for just one procedure (or no time limit at all) using the timelimit statement.

Note that the ScriptTimeOut statement is different from the timelimit statement. Also note that you can specify the scripttimeout value as an additional parameter to the AppleScript statement. That will not affect the endless loop timeout.

In your application you will probably want to use

timelimit 0

at the top of this procedure since you want this code to run as long as needed, no matter what. This will not affect any other procedure.

Separately, if mail is sometimes taking more than 60 seconds to respond, you may want to adjust the scriptimeout value.