Spotify script on TouchBar - sudden failure

Let me start by stating that I realize this may not be in the right place, please feel free to move it.
I have 2 items on by TouchBar for music - I found them here on the forums.
The first one shows a play button and switches to a pause button when pressed, the other shows the track name (only showing when something is playing). I'm sure many of you have seen or are using these.
This morning, I noticed that the Play/pause button is missing and even if I manually start something in Spotify, the track info doesn't show up. After restarting BTT a few times, I looked at the code. It was all the same color (I SWEAR it changes when the code is checked) so I ran the Compile / Check Syntax and get an error on BOTH scripts.

The lines in question are:

if player state is playing then return "pause"

On the other script it is:

if player state is playing then

For both of these, when BTT checks the code, I get a pop-up that says "Expected “then”, etc. but found identifier." It will highlight the word STATE in both instances.

Any ideas? This has been running without any changes for a couple months. If someone wants to tell me how to post the code here so it formats correctly, I will do so.


Maybe try restarting your Mac, sometimes the Apple Script services get confused :slight_smile:

That fixed it! What an odd behavior. I think I may have restarted about an hour before noticing the issue, so that may have set it off (memory is not clear on timing).
Regardless, I don't have to try to fix a script that should have been working so I'm REALLY happy!

Maybe this will help someone else in the future :slight_smile: