4392 Views 2 Replies Latest reply: Apr 9, 2011 3:15 PM by Livin Easy
Error -10004 is an Apple Event Privilege Error. From the 10.6 AppleScript Release Notes - "For security reasons, most scripting addition commands now return a “privilege violation” error when sent between application processes." The say command is from *Standard Additions* (a scripting addition), so it should either not be used in a Finder tell statement, or prefixed with a tell me or tell current application so that you are not targeting the Finder - for example
tell application "Finder"
tell me to say "85"
In your second example, the try statement is trapping the error, but you are not doing anything with it. You should only target a particular application with terminology it knows (as previously mentioned), or fine tune the statements that you want to use the error trapping with (in addition to actually doing something with the error).
Thank you. I now know better, about the lack of 'say' among Finder commands.
For my actual Applescript I will use your advice well. For assuring a text string is as intended, I might use a different technique instead of 'say' for debugging text manipulation. But the call to TextEdit or other 'speak text' application does OK for now.
Thanks again. Problem solved.