[MlMt] Counter in dock icon
Pascal Felber
pfelber at pobox.com
Fri Oct 5 07:00:42 EDT 2018
Hi,
I am using BetterTouchTool together with the GoldenChaos-BTT extension
to customise the touch bar of my laptop, and notably show the number of
unread messages. There are a number of scripts provided to extract the
number of unread messages from various mail clients, but not MailMate.
When trying to adapt the scripts to support MailMate, I got the feeling
that MailMate does not use the same UI elements to display the
counter/badge. For all other applications, the scripts extracts the
number as follows:
set badgeNumber to value of attribute "AXStatusLabel" of UI element
"MailMate" of list 1
but this returns systematically an empty value, whereas for other
programs that have a badge I would get the count.
If there is any alternative way to easily get this value, I'd be glad to
know. Thanks!
Pascal
P.S. For reference, here is the full script for Apple Mail:
if application "Mail" is running then
tell application "System Events"
tell process "Dock"
try
set badgeNumber to value of attribute "AXStatusLabel" of UI element
"Mail" of list 1
if badgeNumber exists then
if badgeNumber contains "iPhone" then
return "iPhone"
else if badgeNumber contains "iPad" then
return "iPad"
else if badgeNumber contains "watch" then
return "Watch"
else if badgeNumber contains "Mac" then
return "Mac"
else
return badgeNumber
end if
else
return ""
end if
on error
return ""
end try
end tell
end tell
else
return ""
end if
More information about the mailmate
mailing list