I’ve written a few scripts that let a user choose a file and then convert it to another format. I perform various tests to see whether the chosen file is in a format that the script can convert. But I still can’t solve one problem:
“Choose file” lets a user select a file that’s really a package - for example the “About Downloads” file in the Downloads folder in Mountain Lion (and and perhaps other versions) is really a package containing folders with many PDF files. Is there a simple way to detect when a user has chosen a package so that I can display an error message?
I thought of testing for a colon as the last character of the path reported by System Events, but I wonder if there is a more direct method.
Thanks for any advice.