Re: List filtering
Re: List filtering
- Subject: Re: List filtering
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 2 Sep 2010 06:29:06 -0400
On Thu, Sep 2, 2010 at 3:19 AM, Alex Zavatone <email@hidden> wrote:
>
> On Sep 2, 2010, at 1:31 AM, Joe wrote:
>> tell application "Finder" to set filList to (every file in the entire contents of thisItem whose file type is "osas" or creator type is in {"aplt", "dplt"} or name ends with "scpt") as alias list
>>
>
> Thanks man, that's exactly what I was trying to figure out how to do.
Just bear in mind that the Finder is excruciatingly slow at this sort
of thing compared to shell commands, so if there are a lot of files
under the folder in question, you might be better off using do shell
script.
set fileList to paragraphs of (do shell script "find " & (quoted form
of POSIX path of rootFolder) & " -name '*.png'")
Of course the above doesn't examine HFS metadata like creator or file
type, And the result is just a list of strings - you can't map a
"POSIX file" across a list like that in one fell swoop, either, so if
you want actual file objects/aliases, it's loop time again. But on
large directory structure, you're looking at sub-second vs
multi-minute runtimes.
--
Mark J. Reed <email@hidden>
_______________________________________________
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