Applescript从10.6到10.7的差异
首先,我是苹果和mac操作系统的初学者 我已经为10.6编写了一个脚本,以便在Java程序中使用拼写检查器:Applescript从10.6到10.7的差异,applescript,spell-checking,Applescript,Spell Checking,首先,我是苹果和mac操作系统的初学者 我已经为10.6编写了一个脚本,以便在Java程序中使用拼写检查器: tell application "Automator Runner" set mySpellChecker to call method "sharedSpellChecker" of class "NSSpellChecker" set foundLanguages to call method "availableLanguages" of mySpellChec
tell application "Automator Runner"
set mySpellChecker to call method "sharedSpellChecker" of class "NSSpellChecker"
set foundLanguages to call method "availableLanguages" of mySpellChecker
end tell
这在10.6以下效果很好
但现在在10.7.2下,即使在applescript控制台下,也会在以下位置发生错误:
tell application "Automator Runner"
set mySpellChecker to call **method** "sharedSpellChecker" of class "NSSpellChecker"
set foundWords to call method "availableLanguages" of mySpellChecker
end tell
**应为行尾,但找到标识符
谁能给我一个提示,从10.6到10.7发生了什么变化。在变更日志中,我找不到AppleScript变更或拼写检查器API变更。使用“调用方法…”的其他web脚本也会失败,并出现相同的错误。是的,在10.7中,“调用方法”命令似乎不再有效。苹果已经在10.6中逐步淘汰了它,并最终在10.7中完全废除了它。他们用AppleScriptObjC语言取代了这种访问objective-c方法的方式。因此,他们在10.7中添加了applescript。现在可以直接在AppleScript编辑器中编写AppleScriptObjC代码。在10.6下,您只能通过Xcode使用它。所以我们失去了一些东西,但我们也得到了一些东西。我们可以争论哪种方式更好,但苹果认为AppleScriptObjC是前进的方向