Created
November 3, 2011 22:07
-
-
Save mikz/1337933 to your computer and use it in GitHub Desktop.
Rate current song in iTunes - Alfred Extension - requires macruby
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
read -s -r -d '' SCRIPT <<"EOF" | |
framework 'ScriptingBridge' | |
rating = ARGV.pop | |
itunes = SBApplication.applicationWithBundleIdentifier("com.apple.itunes") | |
track = itunes.currentTrack | |
track.rating = rating.to_f*20 | |
puts "#{track.artist} - #{track.name} rated #{rating} stars" | |
EOF | |
/usr/bin/env macruby -e "$SCRIPT" {query} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment