开发者

Error On Say Function

开发者 https://www.devze.com 2022-12-15 02:42 出处:网络
I\'m using the Apple Script Editor that came with Mac System 7.5.5 and trying to run a simple program:

I'm using the Apple Script Editor that came with Mac System 7.5.5 and trying to run a simple program:

say "Starting to empty the trash."
tell application "Finder"
  empty trash
end tell
say "Finished emptying the trash."

But when I click in the run button, I got this:

Say Error http://img502.imageshack.us/img502/7341/applescripterror.png

I got this code from the book AppleScript L开发者_运维问答anguage Guide from Apple, published in 1999.


I'm pretty sure the problem here is that the say command is not supported by the version of Applescript that ships with MacOS 7.5.5. I'm not sure exactly which version of Applescript that is, but I found this page in the Wayback Machine that refers to Applescript 1.1.2 shipping with MacOS 8. The docs page that Michael linked to for the say command is for Applescript 2.1, so I'm guessing say didn't come into being until somewhere in the 8.x or possibly even 9.x era.


This 1996 AppleScript Scripting Additions Guide seems nearly contemporary to System 7.5.5 and does not mention say. You might poke around in something like System:Extensions:Scripting Additions to see if you can pull up their dictionaries. Probably System 7.5.5 predates say.

0

精彩评论

暂无评论...
验证码 换一张
取 消