spotify can't shuffle or repeat from outside app, driving me crazy

Every other send to spotify app shortcuts work, except shuffle and repeat, they only work within spotify now, spotify or btt must have changed something.

There has to be some workaround, especially as spotify idiotically turns off repeat status when you change songs so I used to have a trigger to turn it back to repeat as it was. Now I can't.

Gotta be some way, with km maybe, automator, something,

maybe the "send shortcut to specific application" action can help. It allows to briefly activate an app, send thr shortcut, the send it to the background again.

Hi andreas, yes it works but the split second foreground and background action is a bit distracting if I'm coding or doing other things while listening to music.

It used to work send specific application in general without foreground/background that's how my other shortcuts with spotify work, might need a script, will ask in km forum as well they're usually knowledgeable and helpful


yes I quickly checked and I think Spotify allows to trigger repeat via Apple Script, so that shoud be straight forward to script :slight_smile:

you happen to be proficient in applescript (I'm not) to know a quick dirty script for shuffle and repeat functions? those are all I need, btt works for ther rest natively.

The basics are

tell application "Spotify"
	set repeating to true
end tell
tell application "Spotify"
	set shuffling to true
end tell

thanks well at least I know it works from an off to on state from applescript, but doesn't toggle unfortunately, I asked in km forum, if you can be arsed to figure out toggle I would appreciate but if not no worries.

take care

Here a small example for the repeating property, shuffle will work the same:

tell application "Spotify"
    if repeating is true then
        set repeating to false
        set repeating to true
    end if
end tell

By the way: ChatGPT is great for this kind of stuff. Just tell ChatGPT the Apple Script Dictionary of the app, then ask it to create a script. You can get the dictionary for any app using Apple's Script Editor app => File => Open Dictionary

thanks, I was trying chatgpt first but its suggestions were throwing up errors

spotify seems to work on true false system, but really what I want is to go from a true or on repeat state to a one repeat state, as when you switch songs it automatically switches to a single loop not a one loop which I prefer, or just a toggle to go through all three if you know what I mean.

last thing I ask then should be all set.

unfortunately I don't think the Apple Script functions offered by Spotify allow for that ;-(

hrm, ok well, thanks anyway, some language will allow for it I'm sure.

have a good sunday :slight_smile:

Apple Script is the only interface to the spotify desktop app on macOS, all other access is just a wrapper around that. So it's unlikely there is another way to achieve this ;-(
Maybe the web api can do it, but I don't think it can control the desktop app.

yeah thanks anyway, I set it up to instantly bring up and close the app and it works how I wanted it to, and I'm getting used to it that way, looks like the only way since spotify changed shuffle and repeat properties for some strange reason.