Below my script to open only an indesign or pdf file. But when i get the “choose file” window i can select all types of files, while its only supposed to select a file whose extention is indd or pdf. It works well without adding PDF.
set myDocument to (choose file with prompt "choose file :" of type {"IDd5", "PDF"} without invisibles)
set extention to get file type of (info for (myDocument))
if extention is "IDd5" then
-- do something
else
tell application "Preview"
open myDocument
end tell
end if
What’s going wrong?
ps:
to get the file type of any file I use this script:
get file type of (info for (choose file))