Re: Return file list sorted by modification date instead of alphabetically
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