aboutsummaryrefslogtreecommitdiff
path: root/segments/np_rdio_mac.script
blob: d46bd0f9b2a4f0f49b929187121e53e478a4ad3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env osascript
# Returns the current playing song in Rdio for OS X.

tell application "System Events"
  set process_list to (name of every process)
end tell

if process_list contains "Rdio" then
  tell application "Rdio"
    if player state is playing then
      set track_name to name of current track
      set artist_name to artist of current track
      set album_name to album of current track
      set now_playing to artist_name & " - " & track_name
      # Uncomment if Album name is wanted
      #set now_playing to now_playing & " - " & album_name
      end if
  end tell
end if