• 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: Return file list sorted by modification date instead of alphabetically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Return file list sorted by modification date instead of alphabetically


  • Subject: Re: Return file list sorted by modification date instead of alphabetically
  • From: Luther Fuller <email@hidden>
  • Date: Wed, 12 Mar 2014 14:08:41 -0500

On Mar 12, 2014, at 10:06 AM, Bert Groeneveld wrote:

What I need now is the same list, but than sorted by modification date with the newest files first (instead of sorted alphabetically). Is someone able to help me and edit Mark's code? I am unable to figure this out myself.

This looked familiar, so I looked in an old script and found ...

set rawMsgList to (reverse of (sort {get items of sourceFolder} by modification date)) -- Leopard needs {}

So, I did some experimenting. Like this ...

property sourceFolder : alias "OS_X:Library:Application Support"
on run
tell application "Finder"
-- set fileList to sort (get items of sourceFolder) by modification date
set fileList to (reverse of (sort (get items of sourceFolder) by modification date))
end tell
item 1 of fileList as text
log the result
end run

This seems to do what you need ... and does not need 'do shell script'.
(But, perhaps you had something else in mind that I overlooked. ?)



 _______________________________________________
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

  • Follow-Ups:
    • Re: Return file list sorted by modification date instead of alphabetically
      • From: Bert Groeneveld <email@hidden>
References: 
 >Return file list sorted by modification date instead of alphabetically (From: Bert Groeneveld <email@hidden>)

  • Prev by Date: Return file list sorted by modification date instead of alphabetically
  • Next by Date: Re: Return file list sorted by modification date instead of alphabetically
  • Previous by thread: Return file list sorted by modification date instead of alphabetically
  • Next by thread: Re: Return file list sorted by modification date instead of alphabetically
  • Index(es):
    • Date
    • Thread