Created
September 17, 2017 13:12
-
-
Save chmurph2/1f606f1bafff9b729bf6ce77a9a20421 to your computer and use it in GitHub Desktop.
AppleScript Audio: Go to Current Playing Track
This file contains 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 characters
# Goes to iTunes or Spotify (in that order of priority), shows the currently playing track. | |
if appIsRunning("iTunes") then | |
tell application "iTunes" to activate | |
try | |
tell application "System Events" | |
tell process "iTunes" | |
tell menu bar 1 to pick menu item "Go to Current Song" of menu "Controls" | |
end tell | |
end tell | |
end try | |
else if appIsRunning("Spotify") then | |
tell application "Spotify" to activate | |
end if | |
on appIsRunning(appName) | |
tell application "System Events" to (name of processes) contains appName | |
end appIsRunning |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment