choose file of type {"com.apple.iWork.pages.pages", "com.apple.iWork.pages.sffpages"}
choose file of type {"com.apple.iWork.Pages.sffpages"}
choose file of type {"com.apple.iWork.Pages.pages"}
As you may see, to be sure I use pages and Pages to be sure that it’s not case sensitive.
end tell
return wrong values.
Above you may see that I got “com.apple.iwork.pages.pages” for an item whic is a flatfile and for an other item which is a package.
Try to use :
choose file of type {“com.apple.iWork.pages.pages”, “com.apple.iWork.pages.sffpages”}
KOENIG Yvan (VALLAURIS, France) mardi 9 juillet 2013 19:05:08
Thank you! That explains everything, I can’t believe it’s depreciated now!
I made my app a long time ago, now I’m updating it. It appears that I went to the trouble of finding the identifiers for a large collection of file extensions, I must have had a reason for it, it would make more sense to just use for example
choose file of type "pages"
but I didn’t, I can’t remember why using file extensions was a bad policy, I guess I’ll just leave it mostly how it is, silly me!
info for is deprecated for years but it’s not the problem striking here.
As I wrote, info for and system events return the type identifier “com.apple.iwork.pages.pages” for packages AND for flatfiles.
The difference appear if we look at the “package” property.
my beCurious((path to users folder as text) & "Important:iWork:documents_Pages:SCR leaflet-1.pages") # flatfile
(*
--> {package folder:false, type identifier:"com.apple.iwork.pages.pages"}
--> {type identifier:"com.apple.iwork.pages.pages", package folder:false}
*)
my beCurious((path to users folder as text) & "Important:iWork:documents_Pages:emafre.pages:") # package
(*
--> { package folder:true, type identifier:"com.apple.iwork.pages.pages"}
--> { type identifier:"com.apple.iwork.pages.pages", package folder:true}
*)
on beCurious(a_doc)
info for file a_doctell application "System Events"
properties of disk item a_doc
end tell
end beCurious
Given that, I repeat that the only valid scheme (at least at this time) is to use :
choose file of type {“com.apple.iWork.pages.pages”, “com.apple.iWork.pages.sffpages”}
In fact I assume that I discovered that long time ago and forgot it because in several of my scripts, I use the two type identifiers and don’t rely upon this property to decide if I must expand a package to be able to decipher the embedded index.xml file.
I apologize if I am a bit late but I was fighting against an invasion by caterpillars in my garden.
KOENIG Yvan (VALLAURIS, France) mardi 9 juillet 2013 21:26:30
With iWork documents there is no problem.
If the docname doesn’t end with the name extension the apps are unable to open them.
It’s not the same with other applications.
When I used AppleWorks, I was accustomed to put the name extension (cwk) but the application was able to open files with no extension so, testing this attribute wasn’t a valid test.
KOENIG Yvan (VALLAURIS, France) mercredi 10 juillet 2013 11:22:39