Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Now Playing script for Textual that works for both online radio streams and music library.
on textualcmd()
set nowPlaying to "I'm not currently playing anything."
# iTunes
if isRunning("iTunes") then
tell application "iTunes"
if player state is playing then
if current stream title is not missing value then
set nowPlaying to "/me is currently listening to '" & current stream title & "' on " & name of current track & "."
set nowPlaying to "/me is currently listening to '" & name of current track & "' by " & artist of current track & " from '" & album of current track & "'."
end if
end if
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

This comment has been minimized.

Copy link
Owner Author

@ApoorvKhatreja ApoorvKhatreja commented Feb 28, 2013

Put this file in ~/Library/Application\ Support/Textual\ IRC/Scripts/np.scpt


This comment has been minimized.

Copy link

@pratul pratul commented Aug 5, 2013

The Application Support folder path doesn't work any more. As per the wiki, the correct path is...

~/Library/Application Scripts/com.codeux.irc.textual/

Also, the /me is verbally outputted to the channel now, instead of being sent as an action. So I changed it to just "Listening to...".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.