Improved Now Playing (Textual IRC)

By dsabecky on Sep 27, 2011

This is a simple "now playing" announcer for Textual (http://www.codeux.com/textual/) that pulls the information from Spotify, iTunes, and QuickTime (whichever you're using at the time)

Save the code as np.scpt and place it in ~/Library/Application Support/Textual/Scripts

To run the script, type /np in a channel or query window.

on textualcmd()

    set nowPlaying to "I'm not currently playing anything."

    # Spotify
    if isRunning("Spotify") then
        tell application "Spotify"
            if player state is playing then set nowPlaying to "Spotify: " & artist of current track & " - " & name of current track & " (" & album of current track & ")"
        end tell
    end if

    # iTunes
    if isRunning("iTunes") then
        tell application "iTunes"
            if player state is playing then set nowPlaying to "iTunes: " & artist of current track & " - " & name of current track & " (" & album of current track & ")"
        end tell
    end if

    # QuickTime Player
    if isRunning("QuickTime Player") then
        tell application "QuickTime Player"
            if playing of document 1 then set nowPlaying to "QuickTime: \"" & name of document 1 & "\""
        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

Comments

Sign in to comment.
DevilsFire   -  Dec 18, 2013

Hey, do you have any idea on how to make a "mass voice" script for Textual? there's a bunch for mIRC but i haven't seen one for Textual is it possible?

 Respond  
dsabecky   -  Sep 27, 2011

What do you mean?

 Respond  
Jordyk19   -  Sep 27, 2011

Very nice, could you make one for Notifo? that would be awesome.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.