I am not sure why this is happening, but I have an applescript that is running a shell script and supposed to return a variable. Randomly, the script will pop-down an error that says “Error: Applescript Event timed out” and it will highlight this area of my script:
set thePackageUrl to do shell script "/Applications/Utilities/pcl/pcl publish --username=me@myemail.net --password=pw --pandofile=\"/Users/vtaccess/Pando/packages/" & myFile & ".pando\" --sender=\"VMX\" --title=\"" & Nm & "\" --logdir=\"/Users/vtaccess/Pando/logs/\" --sessiondir=\"/Users/vtaccess/Pando/session/\" --certdir=\"/Users/vtaccess/Pando/cert/\" " & destinationFile & ""
However, I am watching the log file generated by that shell script, and it continues the process until it’s complete, and then closes the application as it should. So why does my AS randomly throw this error and not complete the full script (after it finishes the shell command, it’s supposed to send an email, but when this error happens, that email never gets sent). I have no “with timeout of” lines or anything like that…I tried that at one point but it made no difference and continued to throw the error.
I’m wondering about this behavior, because the timeout error occurs actually only while sending Apple Events to an application
and getting no response. Do shell script doesn’t send Apple Events, or does it?
Learned something new again. My “with timeout” statement wasn’t working until I put it between “try” statements. Didn’t know that before. Thanks for the help!