Re: Getting a subset list of files
Re: Getting a subset list of files
- Subject: Re: Getting a subset list of files
- From: KOENIG Yvan <email@hidden>
- Date: Sat, 02 Apr 2011 15:47:40 +0200
Le 2 avr. 2011 à 15:13, Jim Brandt a écrit :
> I have a need to get a list of files from a folder that has a lot of files in it (currently over 3900). The subset is defined by the first piece of the file name. So to test this, I put together this snippet of code:
>
> set Originals to "HD1:InfoMac:•Orginals:"
> set MacD to "MACSCRPT Digest " & (do shell script ("date \"+%Y\"") as text)
> tell application "Finder" to set OrgList to every file of folder Originals whose name begins with MacD
> display dialog (count of OrgList) as text
>
> Currently there are 23 files that meet this criteria.
>
> The script ends in a error that it has timed out. While I know how to fix that, its unacceptable for it to take as long as it does.
>
> My question:
>
> Is there a faster way to isolate a list of files from a larger set based on part of the name?
Why are you asking to the Finder which is really slow?
Asking to System Events would be faster and I guess that there is a shell call doing the trick more faster.
Yvan KOENIG (VALLAURIS, France) samedi 2 avril 2011 15:46:52
_______________________________________________
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