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

Import Songs into iTunes Playlist in Correct Order Apps
When you drag multiple files from a folder into an iTunes playlist, iTunes usually doesn't keep them in the proper order. I've found that if you just drag the folder itself into the playlist, it does keep them in the correct order. I usually delete any non-music files from the folder before I import.

[kirkmc adds: It's true that iTunes doesn't keep individual tracks in order when you add them by dragging, unless your playlist is sorted by album and the tracks are tagged with the appropriate track numbers. Also, you don't need to worry about removing non-music files, unless the folder contains videos (in formats that iTunes understands) or PDFs; iTunes simply ignores these other files.]
    •    
  • Currently 3.17 / 5
  You rated: 4 / 5 (6 votes cast)
 
[35,452 views]  

Import Songs into iTunes Playlist in Correct Order | 10 comments | Create New Account
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: billabOng on Oct 01, '07 08:35:45AM

If your directory has a .m3u file, you should remove it before you drag it into iTunes.. Otherwise, you will end up with duplicates. I believe you could just double-click the .m3u to add the tracks to iTunes as well.



[ Reply to This | # ]
Import Songs into iTunes Playlist in Correct Order
Authored by: boredzo on Oct 01, '07 09:01:42AM

It's true that iTunes doesn't keep individual tracks in order when you add them by dragging, unless your playlist is sorted by album and the tracks are tagged with the appropriate track numbers.

It probably doesn't do it then, either. Remember, the order the songs have in the playlist is not the same as the order they're displayed in, if you have iTunes set to show the playlist with a sort. If you want to view the actual (unsorted) order, click on the very far left column in the table header.



[ Reply to This | # ]
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 | # ]
Import Songs into iTunes Playlist in Correct Order
Authored by: soundsgoodtome on Dec 07, '13 10:51:41PM
I pasted this into AppleScript Editor, compiled it, and saved it as an application — but it's not working. In the years since this was posted, has Apple made changes to AppleScript that would cause this to no longer work?

Also, with tracks in the Finder properly prefixed with 2-digit numerals, I'd like the script to import them in reverse order, so that they appear in correct order when sorting in iTunes by date added.

I'm no AppleScript expert, but I found the following command-modifier elsewhere in another script. Can someone tell me if changing...

set theSongs to sort theSongs by name

to

set theSongs to sort theSongs by reverse of name

…will do the trick?


UPDATE: Though I still wouldn't mind the answers to my questions above, I just found an AppleScript that does exactly what I want (imports tracks into iTunes in the order opposite the way they're currently displayed in the Finder):

http://dougscripts.com/itunes/2013/11/add-file-in-reverse-sort-by-date-added/

Handy! (Obviously it could also be modified to import tracks without reversing them.)


Edited on Dec 07, '13 11:02:11PM by soundsgoodtome


[ Reply to This | # ]
Import Songs into iTunes Playlist in Correct Order
Authored by: soundsgoodtome on Oct 20, '07 02:51:56PM

I don't find any of these tips or methods to be fail-safe. Even with tracks whose names begin with track numbers, there seems to be no reliable way to get them to import in proper consecutive order.

I just tried setting a folder of tracks to column view, as suggested above -- and the tracks are also named sequentially -- but each time i drag the folder into itunes, the tracks are imported in some random order.

If these various methods are working 100% of the time for those who posted them, there must be other factors that come into play.

I typically keep iTunes sorted by "date added," so i can quickly see the items I've added most recently at the top. While sorted in that manner, I've found the only way I can add an album and have it play in order (without having to create a separate playlist) is to add the songs individually, starting with the highest-numbered track, and working backwards. But that's tedious, so I usually create a playlist of the album and sort by album or track number (which are essentially the same).



[ Reply to This | # ]
Import Songs into iTunes Playlist in Correct Order
Authored by: ptilol on Nov 18, '07 05:54:27AM
If your files are numbered (Imean, in the filename), I found an easy way to solve that with Automator.

Create an Automator process that

- Gets the selected files in the Finder (Finder section)
- Sorts the files (Finder section)
- Adds them to a playlist (iTunes section). Choose the Library playlist.

Then, I use http://dougscripts.com/itunes/scripts/scripts09.php?page=5#albumizeselection to number the freshly added files.

Maybe it also works without pre-sorting the files in case your filenames are not numbered but listed in the correct order in the Finder (by which magic?). I did not try that.

Let us know if it is a good start for your problem.

Cheers, PtiLol

[ Reply to This | # ]
Import Songs into iTunes Playlist in Correct Order
Authored by: sloveall on Jan 06, '11 01:04:13PM

When using Add to Library from iTunes, be sure the order in folder is the order you want (column view), and when prompted for the folder to add, Option-click on the folder you wish to add to your library. The order should be maintained as displayed in the finder.

Especially useful for things like audio books or course-work that contain sequential content.



[ Reply to This | # ]
Import Songs into iTunes Playlist in Correct Order
Authored by: Orj on Jul 29, '13 05:40:49AM

I have the same problem: I like to import the last tunes (of a cd, or series of tunes) first, so that it comes last when ordering the tunes in my library by last date added. But to this day, I found no way to get a predictable result, except opening the files one by one in the Finder; tedious! If I select 2 or more to open (or if I click too fast on different files), they seem to get opened by (reverse) alphabetical order of the tune's name, as defined by eg. the mp3 tag; NOT by anything related to file name, whatever the Finder viewing mode I select. Btw, this is also the default ordering of albums, when no track number is defined.

So the only failsafe method I've found is quite dirty, but works in a terminal window, assuming the filenames are correctly ordered:
$ cd folder_with_my_tunes/
$ perl -e 'while ($_=pop @ARGV) {print "$_\n"; system "open","-a","iTunes","$_"; sleep 1;}' *.mp3

Of course, "*.mp3" can be replaced by anything, eg "01*.m4a" for all mp4audio files starting by "01".
To open files in exactly the opposite order, replace "pop" by "shift".

---
In theory, theory and practice are the same. In practice, they're not.



[ Reply to This | # ]