Created
November 26, 2009 21:26
-
-
Save gerad/243671 to your computer and use it in GitHub Desktop.
Copy iTunes playlists to Android with Ruby
This file contains hidden or 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 'rubygems' | |
require 'appscript' | |
require 'ftools' | |
it = Appscript.app('iTunes') | |
['80s Mix', 'Ridiculously awesome'].each do |playlist| | |
it.playlists[playlist].tracks.get.each do |track| | |
from = track.location.get.to_s | |
to = '/Volumes/ANDROID/Music' + | |
File.dirname(from.gsub /^.*?iTunes Music/, '') | |
puts "Copying #{from} to #{to}..." | |
FileUtils.mkdir_p to | |
FileUtils.copy from, to | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great post: Copy iTunes playlists to Android. Thought Ruby is a good alternative to iTunes.