Created
December 12, 2012 23:39
-
-
Save Daij-Djan/4272736 to your computer and use it in GitHub Desktop.
script itunes and add a track (which you specify in this script) to itunes 11's new up next list
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 "AppleScript Utility" | |
set GUI Scripting enabled to true | |
end tell | |
tell application "iTunes" | |
--get the song | |
set l to playlist "Purchased" | |
set t to item 5 of tracks of l | |
--focus it in list | |
reveal t | |
--show window | |
activate | |
end tell | |
tell application "System Events" | |
-- option enter | |
delay 1 | |
key down option | |
delay 1 | |
key code 36 | |
key up option | |
-- Click the “Play Song” button in the annoying dialog. | |
set w to null | |
try | |
set w to window "Add to Up Next" of application process "iTunes" | |
end try | |
if w is not null then | |
set b to UI element "Play Song" of w | |
click b | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment