• 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: Sort error in Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Sort error in Leopard
      • From: Christopher Stone <email@hidden>
  • Prev by Date: Re: Apple Mail adding attachments hoses signature
  • Next by Date: Re: Apple Mail adding attachments hoses signature
  • Previous by thread: Re: Sort error in Leopard
  • Next by thread: Re: Sort error in Leopard
  • Index(es):
    • Date
    • Thread