ah thanks for finding that! I forgot to delete them
Will upload a new build in a few minutes.
Can confirm fixed in 2.817
Oh how beautifully smooth
@GoldenChaos Just let me nab a few of those new apps... aand it's perfect.
Just noticed an edge case:
I was trying to make a handoff badge for reminders, but it had 1 on it's badge, overriding the handoff value 'iPhone'
Is it possible to seperate the notification value from the handoff values?
Sorry I'm not sure I understand, could you post a screenshot of the Dock in this case?
(I'm not using handoff, not sure how that looks like).
Do you have the accessibility inspector app installed? That could show some additional info.
Instead of using the app name you can already use the URL of the dock item to get t he value:
My handoff valuse can display these:
'iPhone'
'iPad'
'watch'
'Mac'
a Notification Number.
In this situation (Handoff available, but have '1' badge):
The variable returns 1, overriding the handoff 'iPhone'. Normally if there is no badge it'll return details about the connected device, but because there is a notification, that is overrided with a 1.
With my code below, this means that the widget won't show up for handoff.
Code:
tell application "BetterTouchTool" to set LCL_DNDStatus to get_string_variable "DNDStatus"
if LCL_DNDStatus is "OFF" then
tell application "BetterTouchTool" to set badgeNumber to get_dock_badge_for "Reminders" update_interval 5
if badgeNumber is not missing value then
if badgeNumber contains "iPhone" then
return "{\"text\":\"📱\",\"font_size\": 15}"
else if badgeNumber contains "iPad" then
return "{\"text\":\"⬛️\",\"font_size\": 15}"
else if badgeNumber contains "watch" then
return "{\"text\":\"⌚️\",\"font_size\": 15}"
else if badgeNumber contains "Mac" then
return "{\"text\":\"🖥\",\"font_size\": 15}"
else if application "Reminders" is running then
return "{\"text\":\"" & badgeNumber & "\",\"font_size\": 15}"
else
return ""
end if
else
return ""
end if
else
return ""
end if
In that case
get_dock_badge_for "file:///Applications/Reminders.app/" update_interval 5
Should still give you the correct badge number for the reminders app because the handoff badge doesn't have a URL.
I'm looking to get the handoff value, not the badge number.
Ideal way it'll work is that if handoff is availiable, it'll override any number value
Was that solution meant to force the badge number to appear?
Yes.
Ah I see. I don't think overriding the number value would be ideal as it would prevent various usecases. I'll just add a -handoff to the application name/url for these items.
Cool!
that -handoff is included in the latest alpha btw. (so use e.g. Reminders-handoff )
@Andreas_Hegenberg New handoff separation is working well!
@GoldenChaos my code if you're interested:
tell application "BetterTouchTool" to set LCL_DNDStatus to get_string_variable "DNDStatus"
if LCL_DNDStatus is "OFF" then
tell application "BetterTouchTool"
set badgeNumber to get_dock_badge_for "News" update_interval 3
set handoffDevice to get_dock_badge_for "News-handoff" update_interval 3
end tell
if badgeNumber is not missing value and handoffDevice is missing value then
if application "News" is running then
return "{\"text\":\"" & badgeNumber & "\",\"font_size\": 15}"
else
return ""
end if
else if handoffDevice is not missing value then
if handoffDevice contains "iPhone" then
return "{\"text\":\"📱\",\"font_size\": 15}"
else if handoffDevice contains "iPad" then
return "{\"text\":\"⬛️\",\"font_size\": 15}"
else if handoffDevice contains "watch" then
return "{\"text\":\"⌚️\",\"font_size\": 15}"
else if handoffDevice contains "Mac" then
return "{\"text\":\"🖥\",\"font_size\": 15}"
end if
else
return ""
end if
else
return ""
end if
What's the difference between this and my existing handoff support? I'm slightly confused, haha ^^;
Your dock badge:
- Prioritises notifications over handoff
- Shows a number even if the app is not running
My Notification widget:
- Prioritises handoff over notifications
- Does not show notifications while the app isn’t running, but will
- show handoff even if the app isn’t running
- also wrote it more compact but idk if this makes it any more efficient oh well i did any way
Scenario:
Handoff showing in dock for reminders, reminders is not running but has a ‘1’ dock badge too.
(it is running in there but pretend its not)
Mine will show the handoff
yours will get stuck at showing ‘1’ even if handoff is available.
(my old one wouldn’t show at all, because the ‘1’ blocked the handoff label from getting in, and the app isnt running)
Ah, got it! Now I understand why an extra handoff thing was needed. I'll make the change to my dock badges
Can I ask why do you need "update_interval 3" if you also have to Execute Script every x seconds with the Tigger Configuration in BTT?
Something about updating the internal database of badges or something... All I know is you need it there
I do see a BIG difference on CPU Utilization with this new code.
I did some more testing on this, and I've decided that there are still some pretty solid performance benefits to keeping unused badges disabled, so in the next experimental version I'll be reverting the default badge settings back to their previous state
Me too then!