Created
November 17, 2014 17:00
-
-
Save jsvnm/485fe678be3968f51982 to your computer and use it in GitHub Desktop.
hooray for rb-appscript
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
require 'appscript' | |
require 'titleize' | |
def set_tags_from_filename(track) | |
f=track.location.get.path.split('/')[-1] | |
m=f.match(/(\d\d) (.+?) - (.+?)\.mp3/); | |
track.track_number.set m[1] | |
track.artist.set m[2].titleize | |
track.name.set m[3].titleize | |
end | |
Appscript.app('itunes').selection.get.each(|t| set_tags_from_filename(t) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment