• 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: Doug McNutt <email@hidden>
  • Date: Sat, 02 Apr 2011 08:40:52 -0600

At 08:13 -0500 4/2/11, Jim Brandt wrote:
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.

In a shell

cd PathToYourDirectory
MacD="MACSCRPT Digest"`date "+%Y"`
ls $MacD*

Those are back ticks in the second line.
Do you need a new data for every digest? Storing it as a variable before you start might make it look better.


cd PathToYourDirectory
Today=`date "+%Y"`
MacD="MACSCRPT Digest"
ls $MacD$Today*

--

--> From the U S of A, the only socialist country that refuses to admit it. <--
 _______________________________________________
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: Re: Getting a subset list of files
  • Next by Date: Re: Getting a subset list of files
  • Previous by thread: Re: Getting a subset list of files
  • Next by thread: Re: Getting a subset list of files
  • Index(es):
    • Date
    • Thread