applescript / Copy selected tracks files from itunes to new folder

Easily copy your selected tracks from iTunes to a new folder without subfolders for artists etc.

Copy selected Tracks from iTunesDid you ever have an album with different artists and tried to copy the music to your mp3 player (not iPod)? Then you know what this script is for, simply select the tracks you want to copy in iTunes and run this script it will ask you for a folder to copy the track files to, you hit ok and the script will do the rest.

AppleScript copy selected iTunes tracks to a new folder


global selected_track_files, track_titles, files_destination



tell application "iTunes"

	if selection is not {} then

		set sel to selection

		set selected_track_files to {}

		set track_titles to {}

		set files_destination to choose folder with prompt "Where do you want to copy your selected tracks to?"

		with timeout of 30000 seconds

			repeat with current_track in sel

				set end of track_titles to (name of current_track)

				set end of selected_track_files to (get location of current_track)

			end repeat

		end timeout

		if selected_track_files is not {} then

			my copyItunesFiles()

		else

			display dialog "Sorry, couldn't get your selected tracks."

		end if

	else

		display dialog "Select the tracks you want to copy to a new location."

	end if

end tell



to copyItunesFiles()

	set trackTitleList to ""

	tell application "Finder"

		repeat with i from 1 to the count of the selected_track_files

			set currentFile to item i of selected_track_files

			set currentTitle to item i of track_titles

			set trackTitleList to trackTitleList & ", " & currentTitle

			duplicate currentFile to folder files_destination

		end repeat

		if trackTitleList is not "" then

			display dialog "Successfully copied the following tracks: " & trackTitleList

		else

			display dialog "Sorry, couldn't copy your tracks."

		end if

	end tell

end copyItunesFiles

Download application, copy selected iTunes tracks to folder

Copy selected Tracks from iTunesDownload this script as an application (38.4 KB)

Disclaimer: Still-Scripts claims no responsibility for any damage that may occur from the use of any information found here or found on links followed from this page. All items, logos and/or companies mentioned on this and other pages are trademarks, registered trademarks, logos, copyrights, or service marks of the respective companies.