Unread Slack messages

Is there a way to get the unread Slack messages on the Touch bar with BTT?

Thanks!

Patrick

I dont have Slack installed. Does the Mac app show an icon badge in the Dock when you have unread messages?

If yes, try this code in AppleScript Widget.

tell application "BetterTouchTool"
set badgeNumber to get_dock_badge_for "Slack" update_interval 3
end tell
if badgeNumber is not missing value then
if application "Slack" is running then
return "{\"text\":\"" & badgeNumber & "\",\"font_size\": 15}"
else
return "{\"text\":\"" & badgeNumber & "\",\"font_size\": 15}"
end if
else
return ""
end if
2 Likes

Works GREAT! Thanks!!

Hi @K2DesignLab @patrickmast , I've been trying to figure out how to get this to work for an hour now without success.. I'm not very experienced with scripts or customising the BTT, would one of you be a hero and help explain step by step how to add the Slack app and notification to the BTT?

Thank you!

I would think its best for you to download one of the pre-designed full presets, Aquatouch preset is a great start and offers notification buttons for many applications. This should get you pointed in the right direction. You can then just duplicate a current notification button and past my code above into the AppleScript widget, edit the colors etc.

BTT can be a bit overwhelming at first sight, once you understand how the functions work together it will become very powerful and easy to customize for your specific requirements.

the show all unread msgs shortcut is shift+command+a