如何获得使用applescript的默认邮件客户端?
答
我发现这个代码here的一部分,怎么跑这对雪豹一些代码示例( 10.6.4),它对我有用。
on run
set mailClient to getDefaultMailClient() -- store application id
tell application id mailClient to activate -- tell mail client to do something
end run
-- Grab id of default mail client
on getDefaultMailClient()
set prefPath to (path to preferences as text) & "com.apple.LaunchServices.plist"
tell application "System Events"
try
value of property list item "LSHandlerRoleAll" of ¬
(first property list item of property list item "LSHandlers" of ¬
property list file prefPath whose value of property list items ¬
contains "mailto")
on error
"com.apple.mail"
end try
end tell
end getDefaultMailClient
答
另一种选择:VERSIONER_PERL_PREFER_32_BIT=1 perl -MMac::InternetConfig -le 'print +(GetICHelper "mailto")[1]'
似乎并没有对高塞拉利昂工作。因人而异。 – dashard 2018-03-09 12:59:02