Copy link to clipboard
Copied
I’ve been using a Script by Michael L Hale (that utilizes »xmp.getProperty« and Bridge’s »core.quickMetadata«) to determine files’s dimension and resolution without having to open or place them.
Unfortunately it fails with some files (non-Photoshop generated bitmaps, it seems).
(Pdfs I treat differently altogether to avoid the trouble of determining pdf-page counts and potential problems with pdfs containing differently sized pages.)
Do any of you know if and how one can access files’ width, height, resolution with »app.system« in CS5?
I may have come across it before, but can’t locate such a thread currently.
Thanks for any input.
These are 2 options that you could use if you wanted to dump all the info to text file then parse in JS. You could see if either of these contain the data that you are after?
#target bridge var foo = File('~/Desktop/SomeFile.tif'); getAllXMLSIPS(foo); //getMetaDataMDLS(foo) function getAllXMLSIPS(f) { if (f instanceof File && f.exists) { var shellString = "sips --getProperty allxml "; shellString += f.fsName; shellString += ' > ~/Documents/StdOut.txt';
...Copy link to clipboard
Copied
On the Mac Spotlight has plug-ins that filter lots of various file formats metadata (I would have thought PC's have an equivalent?) any how's you should be able to use SIPS, EXIF tools or MDLS to do this…
Copy link to clipboard
Copied
Thanks!
Forgot to mention I’m on a Mac.
Copy link to clipboard
Copied
The PITA with using app.system() is that you need to write the output to file and then read it back. I do use calling app.system() in bridge as thats the only place I can test it. It can be useful to get either large lists pretty quickly or for the odd thing that ESTK just has NO access to. Should be moved to $.system() and available suite wide in IMO. (Look at Dashcode's too)
Copy link to clipboard
Copied
These are 2 options that you could use if you wanted to dump all the info to text file then parse in JS. You could see if either of these contain the data that you are after?
#target bridge var foo = File('~/Desktop/SomeFile.tif'); getAllXMLSIPS(foo); //getMetaDataMDLS(foo) function getAllXMLSIPS(f) { if (f instanceof File && f.exists) { var shellString = "sips --getProperty allxml "; shellString += f.fsName; shellString += ' > ~/Documents/StdOut.txt'; app.system(shellString); } } function getMetaDataMDLS(f) { if (f instanceof File && f.exists) { var shellString = "/usr/bin/mdls "; shellString += f.fsName; shellString += ' > ~/Documents/StdOut.txt'; app.system(shellString); } }
Copy link to clipboard
Copied
Thanks a lot.
That seems to get the information all right.
Copy link to clipboard
Copied
Back to my pseudo account… or is this the real one? I can't keep up…
Copy link to clipboard
Copied
But if you keep at it you might soon have the distinction of being listed in the Top Participants’ Top 5 twice – ain’t that something?
Copy link to clipboard
Copied
I already Im in the Illustrator forum much to my amusement/bewilderment… I suspect the pixie who tots this rubbish up for the predicament…
Copy link to clipboard
Copied
Iiiieh! Illustrator Scripting!
I see the Illustrator team has stuck with tradition and Scripts are still removed from Actions on quitting (or starting?).