Re: newest file in a folder
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