Last active
July 29, 2024 00:14
-
-
Save joshuaswilcox/7251527 to your computer and use it in GitHub Desktop.
Revisions
-
joshuaswilcox revised this gist
Oct 31, 2013 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,3 @@ if application "Spotify" is running and application "iTunes" is not running then tell application "Spotify" if player state is stopped then @@ -20,7 +16,11 @@ if application "Spotify" is running and application "iTunes" is not running then end if end tell else if application "Spotify" is running and application "iTunes" is running then --Get current states of iTunes and Spotify tell application "iTunes" to set itunesState to (player state as text) tell application "Spotify" to set spotifyState to (player state as text) if (itunesState is "paused" or itunesState is "stopped") and spotifyState is "playing" then tell application "Spotify" if player state is stopped then set display to "No Track Playing" @@ -37,7 +37,7 @@ else if application "Spotify" is running and application "iTunes" is running the set display to state & track_artist & " - " & track_name & " - " & (round ((seconds_played / track_duration) * 100)) & "%" end if end tell else if itunesState is "playing" and (spotifyState is "paused" or spotifyState is "stopped") then tell application "iTunes" if player state is stopped then set display to "No Track Playing" @@ -54,7 +54,7 @@ else if application "Spotify" is running and application "iTunes" is running the set display to state & track_artist & " - " & track_name & " - " & (round ((seconds_played / track_duration) * 100)) & "%" end if end tell else if (itunesState is "paused" or itunesState is "stopped") and spotifyState is "paused" then set display to "No Track Playing" else set display to "Crazyman!!!!" -
joshuaswilcox created this gist
Oct 31, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,81 @@ --Get current states of iTunes and Spotify tell application "iTunes" to set itunesState to (player state as text) tell application "Spotify" to set spotifyState to (player state as text) if application "Spotify" is running and application "iTunes" is not running then tell application "Spotify" if player state is stopped then set display to "No Track Playing" else set track_artist to artist of current track set track_name to name of current track set track_duration to duration of current track set seconds_played to player position set state to "" if player state is paused then set state to "(Paused) " end if set display to state & track_artist & " - " & track_name & " - " & (round ((seconds_played / track_duration) * 100)) & "%" end if end tell else if application "Spotify" is running and application "iTunes" is running then if itunesState is "paused" and spotifyState is "playing" then tell application "Spotify" if player state is stopped then set display to "No Track Playing" else set track_artist to artist of current track set track_name to name of current track set track_duration to duration of current track set seconds_played to player position set state to "" if player state is paused then set state to "(Paused) " end if set display to state & track_artist & " - " & track_name & " - " & (round ((seconds_played / track_duration) * 100)) & "%" end if end tell else if itunesState is "playing" and spotifyState is "paused" then tell application "iTunes" if player state is stopped then set display to "No Track Playing" else set track_artist to artist of current track set track_name to name of current track set track_duration to duration of current track set seconds_played to player position set state to "" if player state is paused then set state to "(Paused) " end if set display to state & track_artist & " - " & track_name & " - " & (round ((seconds_played / track_duration) * 100)) & "%" end if end tell else if itunesState is "paused" and spotifyState is "paused" then set display to "No Track Playing" else set display to "Crazyman!!!!" end if else if application "iTunes" is running and application "Spotify" is not running then tell application "iTunes" if player state is stopped then set display to "No Track Playing" else set track_artist to artist of current track set track_name to name of current track set track_duration to duration of current track set seconds_played to player position set state to "" if player state is paused then set state to "(Paused) " end if set display to state & track_artist & " - " & track_name & " - " & (round ((seconds_played / track_duration) * 100)) & "%" end if end tell else set display to "No music app is running" end if