• 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: Nigel Garvey <email@hidden>
  • Date: Mon, 18 Dec 2000 01:32:27 +0000

=?iso-8859-1?Q?H=E5vard?= wrote on Sun, 17 Dec 2000 23:19:14 +0100:

>What is the clean and easy way to get an alias to the newest file of
>a folder? (the one with the newest modification date.)
>
>if I
>tell app "Finder" to get first file of myFolder
>--> first file by name.
>How do I get "last file by date"?

tell application "Finder"
set newFileAlias to (item 1 of (sort every file of myFolder by
modification date)) as alias
end tell

NG


  • Follow-Ups:
    • Re: newest file in a folder
      • From: John McAdams <email@hidden>
  • Prev by Date: Re: Booleans in positional parameter sub routines
  • Next by Date: Removing applet menus without OSAX?
  • Previous by thread: Re: newest file in a folder
  • Next by thread: Re: newest file in a folder
  • Index(es):
    • Date
    • Thread