Re: last modified file - how to catch?
Re: last modified file - how to catch?
- Subject: Re: last modified file - how to catch?
- From: Shane Stanley <email@hidden>
- Date: Mon, 07 Jul 2014 10:10:43 +1000
On 7 Jul 2014, at 7:07 am, okn <email@hidden> wrote:
With AppleScript I know how to get the first or last file in a folder, f ex:
get first file of folder alias "MacHD:Users:okn:Documents:_Output:"
You have included the word "folder"; you don't need the word "alias" as well -- one or the other.
But I need the last file (by property?!) Modification date.
You will have to sort them first:
tell application id "com.apple.finder" set theItem to item -1 of (sort files of desktop by modification date) as alias end tell
Also maybe one should first set the folder window to sort by Modification date, so that the latest file to have been added to the folder _Output would be uppermost?!
No. -- Shane Stanley < email@hidden> < www.macosxautomation.com/applescript/apps/> |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden