• 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: Getting a subset list of files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Getting a subset list of files (From: Jim Brandt <email@hidden>)

  • Prev by Date: Getting a subset list of files
  • Next by Date: Re: Getting a subset list of files
  • Previous by thread: Getting a subset list of files
  • Next by thread: Re: Getting a subset list of files
  • Index(es):
    • Date
    • Thread