Skip to content

Instantly share code, notes, and snippets.

View Govan's full-sized avatar

Gavin Montague Govan

View GitHub Profile
#
# Assuming your address book entries have a URL field 'twitter' containing either their full Twitter URL, or just
# their username, go fetch the image and drop it into the addressbook.
#
# Works for me, but your milage may vary.
#
require 'rubygems'
require 'twitter'
require 'open-uri'
set target_folder to POSIX file "/Users/gavin/Desktop/iTunesOut/"
set the_playlist_name to "Music Only"
tell application "iTunes"
set the_playlist to playlist the_playlist_name
repeat with i from 1 to (number of file tracks in the_playlist)
set the_track to file track i of the_playlist
set the_location to (location of the_track)
tell application "Finder"
copy file the_location to folder (target_folder)