Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save estum/a52839a927d734f938b1f4f5bc1e7bb8 to your computer and use it in GitHub Desktop.
Save estum/a52839a927d734f938b1f4f5bc1e7bb8 to your computer and use it in GitHub Desktop.
iTunes: Toggle disliked of the current track
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