• 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: oldest file of folder1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: oldest file of folder1


  • Subject: Re: oldest file of folder1
  • From: Paul Berkowitz <email@hidden>
  • Date: Tue, 01 Feb 2005 13:15:34 -0800

On 2/1/05 12:59 PM, "Robert Poland" <email@hidden> wrote:

> Here's what I'm trying to do. Apparently "oldest" is not an
> acceptable description. Is there an easy to accomplish this?
>
> tell application "Finder"
> set folder1 to choose folder
> get label index of oldest file of folder1

You need to check what properties are available in the Finder dictionary
entry for 'file' and the objects in inherits from, up to 'item', and use the
appropriate one. There are some applications where the 'first [something]'
in a container will give the object with the lowest ID, thus by definition
the earliest creation date. (Entourage objects for example generally follow
that rule.) But Finder files in containers do not follow that rule - 'first'
is usually first alphabetically by name, I believe, although not guaranteed
to be so. And Finder items don't have unique IDs accessible to AppleScript.
(Maybe one day we'll get access to the file system which could help here.)

The relevant property would be 'creation date'. You may have to do a repeat
loop comparing creation dates. There are people on this list specializing in
doing efficient comparison tests. I imagine that several of them have
routines to do just what you want in an efficient way and that we may be
hearing from some of them soon.


--
Paul Berkowitz


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >oldest file of folder1 (From: Robert Poland <email@hidden>)

  • Prev by Date: oldest file of folder1
  • Next by Date: Re: download a file with a progress bar question
  • Previous by thread: oldest file of folder1
  • Next by thread: Re: oldest file of folder1
  • Index(es):
    • Date
    • Thread