• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sortin an alias list by path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sortin an alias list by path


  • Subject: Re: Sortin an alias list by path
  • From: Jay Louvion <email@hidden>
  • Date: Wed, 05 May 2010 00:49:42 +0200
  • Thread-topic: Sortin an alias list by path

Title: Re: Sortin an alias list by path
On 05.05.2010 0:41, "Stan Cleveland" <email@hidden> spake thus:

On 5/4/10 3:05 PM, "Jay Louvion" wrote:

Just a quick question, before I myself dive into a (possibly) long development;

When considering a list of aliases returned by “every file of entire contents of”, I have noticed that the list doesn’t seem to be returned according to the order of the paths, but (I believe) to the filename, alphabetically.

Has someone already developped a way of sorting this list out according to the path? (getting the list of files from folder “A” before the list from folder “B”, and ideally doing so whatever the depth of hierarchy.

I hope I am clear enough, but feel free to say if not, and I’ll try to be more specific.

Hi Jay,

My first thought is to convert all those file references into strings, then sort them, something like this:

set AppleScript's text item delimiters to return
tell
application "Finder"
    set fileList to paragraphs of (every file of entire contents of folder "Mac HD:Users:stanc:Sandboxes:" as text)
end tell
set
AppleScript's text item delimiters to ""
qsort(fileList, 1, count fileList)
return fileList

My suggestion for the qsort() handler is the one by Nigel Garvey and Randy Knapp, found here:
http://macscripter.net/viewtopic.php?id=17340

HTH,
Stan C.


_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


Thanks Stan,

I’ll gove it a try.

Best and good night from here.

j.

Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva

T+4122 840 3272
F+4122 840 3271

www.studiocasagrande.com

P Please consider the environment before printing this email.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Sortin an alias list by path (From: Stan Cleveland <email@hidden>)

  • Prev by Date: Transmit 3 "on open" vs "choose file" problem
  • Next by Date: Re: Transmit 3 "on open" vs "choose file" problem
  • Previous by thread: Re: Sortin an alias list by path
  • Next by thread: Transmit 3 "on open" vs "choose file" problem
  • Index(es):
    • Date
    • Thread