Guest User

Untitled

a guest
Jan 20th, 2018
1,779
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. DATA=$(osascript -e 'tell application "System Events"
  2. set myList to (name of every process)
  3. end tell
  4. if myList contains "Spotify" then
  5. tell application "Spotify"
  6. if player state is stopped then
  7. set output to "Stopped"
  8. else
  9. set trackname to name of current track
  10. set artistname to artist of current track
  11. set albumname to album of current track
  12. if player state is playing then
  13. set output to "------------------" & "\r" & trackname & " \r" & artistname & "\r" & albumname
  14. else if player state is paused then
  15. set output to trackname & " \r" & artistname & " \r" & albumname & "new_line" & "|Paused|"
  16. end if
  17. end if
  18. end tell
  19. else
  20. set output to ""
  21. end if')
  22. echo $DATA | awk -F new_line '{print $1}'
  23. echo $DATA | awk -F new_line '{print $2}'
Advertisement
Add Comment
Please, Sign In to add comment