如何使用applescript获取默认的邮件客户端?

use*_*685 5 email applescript client

谁能告诉我,如何使用applescript获取默认的邮件客户端?

Gar*_*yde 3

我在这里找到了部分代码,在 Snow Leopard (10.6.4) 上运行它,它对我有用。

\n\n
on run\n    set mailClient to getDefaultMailClient()   -- store application id\n    tell application id mailClient to activate -- tell mail client to do something\nend run\n\n-- Grab id of default mail client\non getDefaultMailClient()\n    set prefPath to (path to preferences as text) & "com.apple.LaunchServices.plist"\n    tell application "System Events"\n        try\n            value of property list item "LSHandlerRoleAll" of \xc2\xac\n                (first property list item of property list item "LSHandlers" of \xc2\xac\n                 property list file prefPath whose value of property list items \xc2\xac\n                 contains "mailto")\n            on error\n                "com.apple.mail"\n        end try\n    end tell\nend getDefaultMailClient\n
Run Code Online (Sandbox Code Playgroud)\n