• 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: newest file in a folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newest file in a folder


  • Subject: Re: newest file in a folder
  • From: Jason Bourque <email@hidden>
  • Date: Sun, 17 Dec 2000 21:18:58 -0500

>> tell application "Finder"
>> set newFileAlias to (item 1 of (sort every file of myFolder by
>> modification date)) as alias
>> end tell
>
>
> One line! That's the cleanest so far. To get the "last file by date"
> change it to:
>
> set newFileAlias to (item 1 of (the reverse of (sort every folder of
> x by modification date))) as alias
>
> jmc
> --
> John McAdams

Maybe a little shorter still.

tell application "Finder"
set x to item 1 of (every item of folder aFolder sort by modification
date) as alias
end tell

or

tell application "Finder"
set x to item -1 of (every item of folder aFolder sort by modification
date) as alias
end tell


Jason Bourque


References: 
 >Re: newest file in a folder (From: John McAdams <email@hidden>)

  • Prev by Date: Re: newest file in a folder
  • Next by Date: Help with Entourage/Outlook
  • Previous by thread: Re: newest file in a folder
  • Next by thread: Re: newest file in a folder
  • Index(es):
    • Date
    • Thread