First post, any help or pointers appreciated. All searching has failed to uncover how to access the page count, dimensions and other information that is displayed in the Get Info window, More Info Pane, for a PDF in the finder. I have search here and Google generally and scanned the dictionary of Finder and Scripting Additions, no clues.
What I am try to get is access to some of the properties displayed when you use the Get Info option in the Finder on a PDF document. In the More Info pane there is specific PDF properties, Title, Version, Pages, Dimensions etc. I need to extract and use these in my AppleScript. Help with syntax or at least correct AS dictionary would be great. Thanks.
You need to use “do shell script” and the mdls command. If you open terminal and type "mdls " and then drag in a PDF, you’ll see the information it returns.
set my_PDF to POSIX path of (choose file without invisibles)
do shell script "mdls " & quoted form of my_PDF
and use it something like this mybe
set _itempath to "PATH TO YOUR PDF"
set _H to do shell script "mdls -name kMDItemPageHeight " & quoted form of POSIX path of _itempath
set _W to do shell script "mdls -name kMDItemPageWidth " & quoted form of POSIX path of _itempath
set _Result to {_H, _W}