Re: Sort error in Leopard
Re: Sort error in Leopard
- Subject: Re: Sort error in Leopard
- From: Nigel Garvey <email@hidden>
- Date: Wed, 08 Feb 2012 09:54:39 +0000
Luther Fuller wrote on Tue, 07 Feb 2012 17:03:10 -0600:
>This line of code works in Snow Leopard and Lion
>
> set msgList to (reverse of (sort items of sourceFolder by modification
>date))
>
>but I just tracked down a bug in Leopard that needed this ...
>
> set msgList to (reverse of (get sort {items of sourceFolder} by
>modification date))
>
>to work correctly. Works in Snow Leopard, too, but I haven't tested in
>Lion, yet.
This works in Tiger and Snow Leopard.
tell application "Finder"
set sourceFolder to target of front Finder window
set msgList to (reverse of (sort (get items of sourceFolder) by modification date))
end tell
>Does anyone see why I need this change?
Back in the days before 'sort' disappeared with the introduction of Mac
OS X, it would take a Finder reference as its direct parameter. When it
was reintroduced (with Tiger, I think), it only accepted lists, so
references had to be realised first. Both seem to be acceptable now.
NG
_______________________________________________
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