Dock badges are such a great feature, but they notoriously hog energy. As I want to do more and more with dock badges, this is really holding me back, also they eat up my system resources which is no fun.
There must be a better way that doesn't use as much energy. Here is a generic dock badge script:
tell application "BetterTouchTool" try set dndEnabled to get_string_variable "dndEnabled" end try end tell if dndEnabled is "false" then if application "Safari" is running then tell application "System Events" tell process "Dock" try set badgeNumber to value of attribute "AXStatusLabel" of UI element "Safari" 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 else return "" end if
The issue is that getting information directly from the Dock process using UI scripting is weirdly inefficient. It just takes more energy for some unknown reason.
Is there some native implementation that would be more energy efficient @Andreas_Hegenberg? I would love to just have dock badges on for all supported apps and have that be that, because I want to include badges for apps that support handoff and the like, apps that don't always run in your dock.
I don't have any answers yet but I wanted to start this discussion in the hopes that somebody might have an idea or two!