I'm creating an AppleScript for my Mac that will tell Spotify to skip or go back a track based on keyboard shortcuts. I believe I have the code correct but cannot get the script to work properly and think it may be due to the if-then statements' positioning.
Any tips on what I can do to make this work?
tell application "Spotify"
activate
if keystroke "e" using {command down, option down, control down} then
tell application "Spotify"
next track
end if
end tell
if keystroke "r" using {command down, option down, control down} then
tell application "Spotify"
previous track
end if
end tell