Can't get sort order to be alphanumeric

Hello,

Dumb question.

I have a script that allows the user to select one or more InDesign docs. The docs I am working with are called

01_a.indd

and

02_b.indd

If the sort order were alphanumberic 01_a.indd should come before 02_b.indd,

That is not the case.

Here is part of the script:


set theAMCDocs to (choose file with multiple selections allowed)
--returns {alias "Macintosh HD:Users:Paeon:Desktop:02_b.indd", alias "Macintosh HD:Users:Paeon:Desktop:01_a.indd"}
tell application "Finder"
	sort theAMCDocs by name
	-- returns {document file "01_a.indd" of folder "Desktop" of folder "Paeon" of folder "Users" of startup disk of application "Finder", document file "02_b.indd" of folder "Desktop" of folder "Paeon" of folder "Users" of startup disk of application "Finder"}
end tell

return theAMCDocs
--returns {alias "Macintosh HD:Users:Paeon:Desktop:02_b.indd", alias "Macintosh HD:Users:Paeon:Desktop:01_a.indd"}

I tried putting in a global variable theAMCDocs so the sort order would be in scope outside of the Finder tell block.

Any suggestions?

Hi,

you sort the files but you don’t save the result


.
set theAMCDocs to sort theAMCDocs by name
.

Note: after sorting the variable theAMCDocs contains a list of Finder file specifiers, not aliases