No need for Satimage. We may do the job with Apple delivered tools.
------------------------------------------------------------------------------------------- # Auth: Christopher Stone # dCre: 2017/02/16 16:00 # dMod: 2017/02/16 16:17 # Appl: Mail # Task: Get Count of Unread Email Messages # Libs: None # Osax: None # Tags: @Applescript, @Script, @System_Events, @Count, @Unread, @Mail, @Email, @Messages ------------------------------------------------------------------------------------------- use AppleScript version "2.4" # ADDED use framework "Foundation" # ADDED use scripting additions # ADDED
tell application "System Events" tell application process "Mail" tell (first window whose subrole is "AXStandardWindow") tell outline 1 of scroll area 1 of splitter group 1 tell rows 1 thru -1 tell first button of UI element 1 set unreadMail to its name end tell end tell end tell end tell end tell end tell
set unreadMail to text of unreadMail
set theArray to current application's NSArray's arrayWithArray:unreadMail # ADDED set theSum to (theArray's valueForKeyPath:"@sum.self") as integer # ADDED
Yvan KOENIG running Sierra 10.12.3 in French (VALLAURIS, France) vendredi 17 février 2017 10:45:34
|