New version!
GoldenChaos-BTT 2.628 changelog:
-
[Now Playing] Completely rewritten media controls logic (again) - this time with no additional performance cost! Much simpler and uses BTT's native internal variables.
-
[Connectivity Actions] Fixed an issue with AirPods battery display
-
[7-Day Forecast] Improved rendering of High/Low arrows
-
[7-Day Forecast] Fixed inconsistent padding between items
Developer's notes
This took a while to debug. Turns out you have to wrap these get_string_variable statements in tell statements, otherwise they won't work. Here's the full code for the Play/Pause button:
tell application "BetterTouchTool"
try
set showMediaControls to get_string_variable "BTTCurrentlyPlayingApp"
set playerState to get_number_variable "BTTCurrentlyPlaying"
end try
end tell
if showMediaControls is not "" then
if playerState is 1.0 then
return "Pause"
else
return "Play"
end if
else
return ""
end if
And the rest of the buttons:
tell application "BetterTouchTool"
try
set showMediaControls to get_string_variable "BTTCurrentlyPlayingApp"
end try
end tell
if showMediaControls is not "" then
return " "
else
return ""
end if
Much simpler, super performant, and has identical behavior to the Now Playing widget.
Screenshots