• 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: last modified file - how to catch?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >last modified file - how to catch? (From: okn <email@hidden>)

  • Prev by Date: Re: last modified file - how to catch?
  • Next by Date: Re: last modified file - how to catch?
  • Previous by thread: Re: last modified file - how to catch?
  • Next by thread: Re: last modified file - how to catch?
  • Index(es):
    • Date
    • Thread