• 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 19:32:02 -0500

> 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"?
>
> Hevard

Try the below.

tell application "Finder"
set x to every file of folder "Scripting Toolkit Zip:" sort by,
modification date
set newestFile to item 1 of x as alias
end tell

Hope this helps.

Jason Bourque


References: 
 >newest file in a folder (From: Håvard <email@hidden>)

  • Prev by Date: Re: newest file in a folder
  • Next by Date: Re: Why won't the trash empty?
  • Previous by thread: Re: newest file in a folder
  • Next by thread: Re: newest file in a folder
  • Index(es):
    • Date
    • Thread