• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

shell script to determine file width, height, resolution cs5 js

Community Expert ,
Dec 22, 2010 Dec 22, 2010

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.

TOPICS
Actions and scripting

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guru , Dec 22, 2010 Dec 22, 2010

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';      

...

Votes

Translate

Translate
Adobe
Guru ,
Dec 22, 2010 Dec 22, 2010

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…

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2010 Dec 22, 2010

Copy link to clipboard

Copied

Thanks!

Forgot to mention I’m on a Mac.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Dec 22, 2010 Dec 22, 2010

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Dec 22, 2010 Dec 22, 2010

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);      } }

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2010 Dec 22, 2010

Copy link to clipboard

Copied

Thanks a lot.

That seems to get the information all right.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Dec 22, 2010 Dec 22, 2010

Copy link to clipboard

Copied

Back to my pseudo account… or is this the real one? I can't keep up…

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2010 Dec 22, 2010

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Dec 22, 2010 Dec 22, 2010

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…

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2010 Dec 22, 2010

Copy link to clipboard

Copied

LATEST

Iiiieh! Illustrator Scripting!

I see the Illustrator team has stuck with tradition and Scripts are still removed from Actions on quitting (or starting?).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines