• 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: g3pb <email@hidden>
  • Date: Sun, 17 Dec 2000 14:31:49 -0900

-- this should do it, note you will need to change the destination folder

tell application "Finder"
set numItems to count of items in alias "iMac:Desktop Folder:AMA:"
if numItems is not 1 then
set aList to every item in alias "iMac:Desktop Folder:AMA:" as alias
list
else
set a to {every item in alias "iMac:Desktop Folder:AMA:" as alias}
end if
set latestFile to modification date of item 1 in aList
repeat with anItem in aList
if modification date of anItem > latestFile then
set latestFile to modification date of anItem
end if
end repeat
end tell

-- hcir
mailto:email@hidden


> 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.)


  • Follow-Ups:
    • Re: newest file in a folder
      • From: Paul Berkowitz <email@hidden>
References: 
 >newest file in a folder (From: Håvard <email@hidden>)

  • Prev by Date: directing tell to CPU on network
  • Next by Date: Re: newest file in a folder
  • Previous by thread: newest file in a folder
  • Next by thread: Re: newest file in a folder
  • Index(es):
    • Date
    • Thread