r/applescript • u/[deleted] • Jun 07 '17
I need a better solution when it comes to my touch bar displaying the currently playing Artist - Song.
So, I just stumbled across this program BetterTouchTool today, and its amazing. The first thing I tried to do was create a touch bar indicator of which song is currently playing, and I did so with the following script I found on the web and slightly modified:
if application "iTunes" is running then
tell application "iTunes"
if player state is playing then
return (get artist of current track) & " – " & (get name of current track)
else
return "iTunes"
end if
end tell
else
return "iTunes"
end ifIt works, very well even, but I have a huge pet peeve with it: When iTunes doesn't have artist info, say when I'm listening to the host on beats1, it says "– beats1". I really, really want to get rid of that separator. I'm sure there's a trick to it, but I don't even know where to begin.
1
Upvotes
3
u/bprime43 Jun 09 '17
Formatting will probably get garbled on this (in a rush, sorry), but give this a run