Re: getting a file list in sorted order
Re: getting a file list in sorted order
- Subject: Re: getting a file list in sorted order
- From: Andy Wylie <email@hidden>
- Date: Mon, 19 Aug 2002 19:29:42 +1200
on Mon, 19 Aug 2002 17:53:37 +1200 Andy Wylie wrote:
>
on Sun, 18 Aug 2002 17:15:15 -0300 Bill Briggs wrote:
>
>
>
> We talked about this off-list, and Nigel's way was faster, but I've
>
>noted that this oddball double coercion is even faster, even when
>
>using the loop (on my test case which had 32 text files). The case
>
>that took 10 seconds coercing directly from file ref to alias takes
>
>less than a second this way.
>
>
>
> set pathString to item 1 of theList as text
>
>
:) I now feel vindicated for pedantically using i for references and n for
>
number in loops, making a new list and setting its end would be slightly
>
faster.
but shrinking the list and picking off item 1 is considerably faster yet...
set aliasList to {}
tell application "Finder"
set _List to (sort (every item of alias source1 whose file type is
"TEXT") by creation date)
repeat (count _List) - 1 times
set aliasList's end to (_List's item 1 as alias)
set _List to _List's items 2 thru its item -1
end repeat
set aliasList's end to (_List's item 1 as alias)
end tell
_____________________________ Andy
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.