Spotify DJ button: any way to click it from the CLI (or AppleScript, or Hammerspoon, or...)

49 views Asked by At

Is there any way to simulate clicking the Spotify DJ button in the macOS Spotify application from outside Spotify, for example with a keypress?

Spotify's DJ button

Of course, I could just bring up the Spotify window and go click it. But I regularly use Hammerspoon to automate many other tasks like window manipulation, so it'd be nice to just be able to just hit a global key binding (say, Shift+) to let the DJ know to move onto the next set, without further interrupting whatever I'm working on.

Some ideas I looked into:

  • Spotify's AppleScript API: I don't see a way to hit that DJ button. (You can view it with the Script Editor app, File -> Open Dictionary, Spotify).

  • Hammerspon's hs.spotify: awesome, but under the hood just uses AppleScript

  • Checking for something in the Menu bar I could click on with hs.application:selectMenuItem(), no relevant menu bar items I could find

  • Some other resources, like CLI tools, Node.js programs, etc, the ones I found were just wrappers for AppleScript

  • Right clicking the Dock icon; Next/Previous but no option for the DJ button

  • libspotify: sunsetted, doubt it supports the recent DJ feature

  • Spotify's Web Playback SDK Reference and Spotify's Web API: would require writing an app, using Oauth, etc—I'd be willing, and I was able to get playlist info about the DJ, but I didn't see anything that does what that DJ button does

  • One not-so-great idea might simply be to simply skip 5 tracks

Thanks.

0

There are 0 answers