Skip to content

Instantly share code, notes, and snippets.

@jalada
Created March 25, 2014 09:42
Show Gist options
  • Save jalada/9758217 to your computer and use it in GitHub Desktop.
Save jalada/9758217 to your computer and use it in GitHub Desktop.
Spotify 'Now Playing' script for Textual (OS X IRC client). Put it in `~/Library/Application Scripts/com.codeux.irc.textual`
on textualcmd()
set nowPlaying to "I'm not currently playing anything."
if isRunning("Spotify") then
tell application "Spotify"
if player state is playing then set nowPlaying to "/me ♫ " & artist of current track & " - " & name of current track & " (" & album of current track & ") " & spotify url of the current track
end tell
end if
return nowPlaying
end textualcmd
on isRunning(mediaPlayer)
tell application "System Events"
tell application "System Events" to return exists (processes where name is mediaPlayer)
end tell
end isRunning
Copy link

ghost commented Aug 10, 2014

The upcoming Textual 5 uses a new folder: ~/Library/Application Scripts/com.codeux.irc.textual5

@jalada
Copy link
Author

jalada commented Apr 2, 2015

Textual now comes with a Spotify script, but it doesn't work with the latest version of Spotify:

Script Execution Failure (spotify.scpt: (null)): /Users/jalada/Library/Application Scripts/com.codeux.irc.textual5/spotify.scpt: execution error: Spotify got an error: Can’t get «class pPlS». (-1728)

Spotify broke AppleScript support, here's the fix:

https://www.unifiedremote.com/tutorials/how-to-get-spotify-version-spotify-101xxx-on-mac-osx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment