Hi all. I just had the fun (and by fun, I mean not fun) of adding try/tell error trapping to every line of my Photoshop Applescript. Amazing how easily 1200 lines of code balloons to 1900 when you do that.
I’m using the approach I published recently
http://macscripter.net/viewtopic.php?id=31555
and I’m running into semi random cases where the command is issued to Photoshop CS4 and it appears not to be received. Applescript just waits 2 minutes till it times out and doesn’t try the command again. Is this expected behaviour?
Here’s the block of code I used
-- invert the selection
set errorOccurred to false
set myTaskMsg to "invert the selection"
set myFailureMsg to "could not " & myTaskMsg
try
tell myDoc
invert selection
end tell
on error errMsg number errNum
set errorOccurred to true
end try
tell me to UpdateActivityStatus(myTaskMsg, errorOccurred, "bail", myFailureMsg)
Should the try be moved within the tell? Since these happen rather randomly, I’m not sure if it will make a difference at all and with 1900 lines of code to pour through, I’d rather know before doing.
Thanks,