Order of Selection

Anyone know why it is that the order of selection of several files (Command down) in the Finder is preserved (not sorted) only if the files are on the Desktop? Try it with this:

set tFilesChosen to {}
tell application "Finder"
	set mySel to selection as alias list
	repeat with aFile in mySel
		set end of tFilesChosen to name of aFile
	end repeat
end tell

{mySel, tFilesChosen}

Hello Adam.

This is more of a feature, than a bug, as it seems to me, that the order in which you select icons are preserved.

Why it may be so is a long shot in the dark:

Maybe it is because you can arrange the stuff on the Desktop manually, in addition to automatically, which all other folders than the Desktop is sorted.

Why it is maybe so, may be that they hadn’t the time, to implement one kind of selection for when you have chosen to arrange the objects of the desktop automatically, and one for manually, but stuck with the one for when you sort the folder manually. (Bad english, I hope you make sense of it.) :slight_smile:

Other than that, I haven’t the faintest clue.

That was my take too, McUsrII. The desktop icons are not sorted automatically by the Finder while all Finder window displays are. Similarly “Choose File” does not remember order of selection. It would be handy sometimes if it did.

Hello.

I am running Mavericks, slightly disturbed I tried the choose file of Standard Additions, and it returned the list sorted, which was the opposite order of how I selected the items. The sorting of the Desktop were set to “none”.

It is still very disturbing, really that you have to rely on sorting the items. But if this is pertient, you can first check to see if the containing folder is the desktop, before checking if the list is sorted, and then sort it if you must. :slight_smile: Laborious, hopefully somebody knows about some way of figuring it out. Maybe the sorted setting of the desktop is in some defaults file.