可以在没有明显启动应用程序的情况下执行AppleScript"tell"调用吗?

eyk*_*nal 5 applescript tell

我有一个邮件规则设置来启动以下AppleScript:

using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
        tell application "Mail"

            -- do stuff, including...
            CheckAddressBook(theName, theAddress)

        end tell
    end perform mail action with messages
end using terms from

on CheckAddressBook(theName, theAddress)
    tell application "Address Book"
        -- do stuff
    end tell
end CheckAddressBook

每当执行此邮件规则时,它都会启动通讯簿.它没有激活,但突然出现在我的桌面上.我的问题是,是否可以告诉块以静默方式启动应用程序,并在完成后退出?

Chu*_*uck 4

如果应用程序不运行,AppleScript 就无法对其进行控制。这就是它的工作原理。您可以使用其他方法来访问地址簿数据库而不启动应用程序,但如果您使用 AppleScript 从地址簿数据库获取数据,则必须启动应用程序。我的建议是简单地添加 F\xc3\xa1bio 所建议的退出命令。

\n