• 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
Puzzled by a whose filter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Puzzled by a whose filter


  • Subject: Puzzled by a whose filter
  • From: KOENIG Yvan <email@hidden>
  • Date: Sat, 26 Mar 2011 16:21:19 +0100

Hello

I wish to get the list of PDF and pages documents available in a folder.

If I filter on a single extension, it behave flawlessly.
If I try to filter upon a list of extensions it fails.
What am I doing wrongly ?

set theFolder to (choose folder "Select the folder storing the iWork ’09 User Guides") as alias

tell application "System Events" to set theManuals to name of disk items of theFolder whose name extension is "PDF"
--> {"Keynote09_Guide_de_l_utilisateur_2011_01_05.pdf", "Keynote09_Raccourcis.pdf", "Keynote09_Shortcuts.pdf", "Keynote09_UserGuide_2011_01_05.pdf",  "Numbers09_guide_de_l_utilisateur_2011_01_05.pdf", "Numbers09_Raccourcis.pdf", "Numbers09_Shortcuts.pdf", "Numbers09_UserGuide_2011_01_05.pdf", "Pages09_Guide_de_l_utilisateur_2011_01_05.pdf", "Pages09_Raccourcis.pdf", "Pages09_Shortcuts.pdf", "Pages09_UserGuide_2011_01_05.pdf",  "zFormulas_and_Functions_User_Guide_2009_09.pdf", "zGuide_de_l_utilisateur_des_formules_et_des_fonctions_2009_09.pdf"}

tell application "System Events" to set theManuals to name of disk items of theFolder whose name extension is "pages"

--> {"ePub Best Practices for Pages.pages", "epub_Meilleures pratiques.pages", "Getting Started.pages", "hidden settings.pages"}

tell application "System Events" to set theManuals to name of disk items of theFolder whose name extension is in {"PDF", "pages"}

--> error number -1700 from {"PDF", "pages"} to reference

Yvan KOENIG (VALLAURIS, France) samedi 26 mars 2011 16:21:14


 _______________________________________________
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: Puzzled by a whose filter
      • From: Christopher Stone <email@hidden>
  • Prev by Date: Re: Used to work
  • Next by Date: Re: Puzzled by a whose filter
  • Previous by thread: Re: Used to work
  • Next by thread: Re: Puzzled by a whose filter
  • Index(es):
    • Date
    • Thread