06/02/11 15:08:32

Toggle Repeat in iTunes with Alfred

Alfred doesn’t allow to toggle repeat in iTunes at the moment.
I’ve taken the toggle iTunes script from my (very old) Quicksilver Actions: Spotlight Port package and reduced it to one line.1

osascript -e "tell application \"iTunes\"" -e "tell current playlist" -e "if song repeat is off then" -e "set song repeat to all" -e "else if song repeat is all then" -e "set song repeat to one" -e "else" -e "set song repeat to off" -e "end if" -e "end tell" -e "end tell"

Just add as a new Terminal/Shell script. Add more as needed. As I said on Twitter: Alfred is hopefully the mighty return of all the lovely one-liners.

  1. I am totally aware that this script breaks the design. I’m already investigating how to integrate GitHub Gists here. Would make a lot things easier. Post any suggestions as comments, please.