Created
January 23, 2021 07:02
-
-
Save Hum4n01d/ae62e6fec4dd622f9f186caebcd728ac to your computer and use it in GitHub Desktop.
Add the currently playing track to your Apple Music library
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
tell application "System Events" | |
tell process "Music" | |
perform action "AXRaise" of window 1 | |
try | |
tell menu bar 1 | |
tell menu bar item "Window" | |
tell menu "Window" | |
click menu item "Switch to MiniPlayer" | |
end tell | |
end tell | |
end tell | |
end try | |
end tell | |
tell process "Music" | |
try | |
tell menu bar 1 | |
tell menu bar item "Song" | |
tell menu "Song" | |
click menu item "Add to Library" | |
end tell | |
end tell | |
end tell | |
end try | |
end tell | |
tell process "Music" | |
perform action "AXRaise" of window 1 | |
try | |
tell menu bar 1 | |
tell menu bar item "Window" | |
tell menu "Window" | |
click menu item "Switch to MiniPlayer" | |
end tell | |
end tell | |
end tell | |
end try | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment