• 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 Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sort Problem


  • Subject: Re: Sort Problem
  • From: Axel Luttgens <email@hidden>
  • Date: Sun, 23 Aug 2009 14:14:17 +0200

Le 22 août 09 à 23:16, Luther Fuller a écrit :

I have a script (in 10.5.8) that tells the Finder to ...

set fileList to sort (files of someFolder whose name extension is "pdf") by modification date

It works perfectly. Realizing that I really didn't need the whose phrase because the files in the folder are always pdf files, I change the line above to ...

	set fileList to sort (files of someFolder) by modification date

Now, I always get the error ...

"Finder got an error: every file of alias \" ... \" doesn’t understand the sort message."

Does anyone know why I get this error?

Perhaps again one of those needed "get" statements?
According to the dictionary, Finder's sort command expects a list of Finder objects.
But a single "(files of someFolder)" appears to be interpreted as a Finder reference.
So, let's explicitly convert the reference into a list of items:
tell application "Finder" to sort (get files of someFolder) by modification date


Axel

_______________________________________________
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: 
 >Sort Problem (From: Luther Fuller <email@hidden>)

  • Prev by Date: sort
  • Next by Date: Re: sort
  • Previous by thread: Re: Sort Problem
  • Next by thread: Re: Sort Problem
  • Index(es):
    • Date
    • Thread