Last active
May 26, 2017 13:52
-
-
Save estum/a52839a927d734f938b1f4f5bc1e7bb8 to your computer and use it in GitHub Desktop.
iTunes: Toggle disliked of the current track
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 characters
on run {input, parameters} | |
tell application "iTunes" | |
set theTrack to get current track | |
if theTrack's disliked then | |
set disliked of theTrack to false | |
display notification "Now is not disliked" with title ¬ | |
"iTunes" subtitle theTrack's artist & " - " & theTrack's name ¬ | |
sound name "Tink" | |
else | |
next track | |
set disliked of theTrack to true | |
display notification "Disliked" with title ¬ | |
"iTunes" subtitle theTrack's artist & " - " & theTrack's name ¬ | |
sound name "Basso" | |
delay 1 | |
try | |
tell application "System Events" | |
tell process "TextEdit" | |
set frontmost to true | |
end tell | |
key down command | |
keystroke "l" | |
end tell | |
on error errMsg | |
display notification "Error: " & errMsg | |
end try | |
end if | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment