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.
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