Why does AS say shell script timed out?

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.

Thanks much.
js

With Timeout Statements

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?

The do shell script command is an Apple Event in itself…

This doesn’t timeout:

with timeout of 2 seconds
	do shell script "cd ~; find . >> ~/Desktop/timeout_test1.txt"
end timeout

This does timeout:

with timeout of 2 seconds
	tell application "Finder"
		do shell script "cd ~; find . >> ~/Desktop/timeout_test2.txt"
	end tell
end timeout

Thanks Bruce, I was looking for a while to find a way to force a timeout while executing a shell script

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!