diff options
author | Cody Hiar <chiar@hybridforge.com> | 2015-08-12 12:06:23 -0600 |
---|---|---|
committer | Cody Hiar <chiar@hybridforge.com> | 2015-08-12 12:06:23 -0600 |
commit | 07fc2644a237187dd4c5680e88f4adadbf533603 (patch) | |
tree | bb6335e180df48c5a6f0b893312857d36ad470f7 /segments/mailcount_apple_mail.script |
Initial commit of the working files
Diffstat (limited to 'segments/mailcount_apple_mail.script')
-rwxr-xr-x | segments/mailcount_apple_mail.script | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/segments/mailcount_apple_mail.script b/segments/mailcount_apple_mail.script new file mode 100755 index 0000000..fca8acb --- /dev/null +++ b/segments/mailcount_apple_mail.script @@ -0,0 +1,14 @@ +#!/usr/bin/env osascript +# Returns the number of unread mails in the INBOX of Apple Mail. + +tell application "System Events" + set process_list to (name of every process) +end tell + +if process_list contains "Mail" then + tell application "Mail" + if unread count of inbox > 0 then + set a to unread count of inbox + end if + end tell +end if |