Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Import Songs into iTunes Playlist in Correct Order' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Import Songs into iTunes Playlist in Correct Order
Authored by: aca on Oct 12, '07 07:37:16PM

When dragging things from the finder into other apps (e.g., into an iTunes playlist), the order that you get depends on what view option you have your Finder window set to. If it's in column view, they should be added in alphabetical order. If it's list view, they come in some other order, which I've never been able to predict precisely (it depends somewhat on the order in which you selected the items, but there's also some other variable that I've never figured out) This "feature" has been around since the first version of OS X, I'm not sure if it's intentional or a bug...
When I drag things from the finder into iTunes, I always switch to column view first, so it's at least in alphabetical order.



[ Reply to This | # ]
Import Songs into iTunes Playlist in Correct Order
Authored by: twang on Oct 15, '07 09:06:47PM
Yeah, this problem annoyed me to no end. I keep my songs sorted by date added, so I hobbled this together. There is probably a better way, but it works like a charm... It lets you drag on a folder, and it sorts then by name and adds them successively ever 2 seconds. you hear the first second of each track as it plows through, opening each, and each is copied to the library.
on open theFolders
	repeat with theFolder in theFolders
		set folderInfo to info for theFolder
		if the folder of folderInfo then
			importAlbum from theFolder
		else
			set folderName to displayed name of folderInfo as string
			display dialog folderName & " is not a folder."
		end if
	end repeat
end open

on importAlbum from theFolder
	tell application "Finder"
		set theSongs to every item of theFolder
		set theSongs to sort theSongs by name
	end tell
	repeat with theSong in theSongs
		set songName to the name of theSong
		set songFile to theSong as text
		set songTitle to getSongTitle from songName
		if songTitle is not false then
			--say "Importing song " & songTitle
			open theSong
			delay 2
		else
			--say "Skipping file " & songName
			delay 1
		end if
	end repeat
end importAlbum

--filter the songName to mp3's only
on getSongTitle from songFileName
	set songTitle to false
	if songFileName contains "mp3" then set songTitle to songFileName
	return songTitle
end getSongTitle


[ Reply to This | # ]
Import Songs into iTunes Playlist in Correct Order
Authored by: Baby Bloc on Jan 14, '11 11:19:39PM
This worked pretty well for me. I did change the script to make it wait longer between imports. Just changed the "delay 2" to "delay 6." And the "delay 1" to delay 6."

I think iTunes is trying to import stuff alphabetically, but sometimes gets messed up when tracks take too long to start (long tracks, etc) and it gets one out of order once in a while. (This happens to me when I manually click on tracks to import them "in order." When I do it too fast, iTunes can't always keep up and puts a shorter one out of order before a longer one.)

So, I changed the script to add that longer wait, and then I saved it as an Application (that was important), and now I can drop folders from the finder into the application icon wherever I put it. It works pretty good. Thanks for that, it's bugged me for a long time.

I'm not sure if the "delay 6" will work with all tracks. I may have to mess with it if I'm doing some albums with really long and short tracks.

[ Reply to This | # ]