2010-10-21 4 views

Répondre

3

J'ai trouvé une partie de ce code here, a couru sur Snow Leopard (10.6.4), et cela a fonctionné pour moi.

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 
+0

ne semble pas travailler sur High Sierra. YMMV. – dashard

-1

il y a eu une discussion sur ce Toppic dans le macscripter-forum là, vous trouverez également quelques exemples de code sur la façon dont test pour la messagerie par défaut client

0

Une autre option: VERSIONER_PERL_PREFER_32_BIT=1 perl -MMac::InternetConfig -le 'print +(GetICHelper "mailto")[1]'

Questions connexes