Created
March 25, 2014 09:42
-
-
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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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
The upcoming Textual 5 uses a new folder: ~/Library/Application Scripts/com.codeux.irc.textual5