Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # save as ~/Library/Application Scripts/com.codeux.irc.textual/np.scpt
- 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
- # VLC Media Player
- if isRunning("VLC") then
- tell application "VLC"
- if playing then set nowPlaying to "VLC: " & name of first window
- 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
Advertisement
Add Comment
Please, Sign In to add comment