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

Simplest way for a script to give me just the ISO number?

Advocate ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

I'd like to be able to run actions in PS based on the ISO number (I know you can do ISO-based processing in Lr — not my goal here).

I know how to run the actions from a script, but not how to get the ISO number...

Doing my homework, I found a handful of threads. Several look daunting, and the few simple ones don't work or are too old...

Who knows the simplest way to just get the ISO number, please? 🙂

TOPICS
Actions and scripting , Windows

Views

160

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

Guide , Jun 08, 2022 Jun 08, 2022
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
var iso = 0
try {
    var xmp = new XMPMeta(app.activeDocument.xmpMetadata.rawData);
    iso = xmp.iterator(XMPConst.ITERATOR_JUST_LEAFNODES, XMPConst.NS_EXIF, "ISOSpeedRatings").next().value
} catch (e) { }
alert(iso)

Votes

Translate

Translate
Adobe
Advocate ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

Example of a simple one that doesn't give me anything... (I'm running it in PS with a pic that does have all the raw settings)...
https://community.adobe.com/t5/photoshop-ecosystem-discussions/help-with-script-to-read-specific-xmp...

Even if it would work, how do I pry out just the ISO number?

Photoshop_plbiADaJtd.jpg

-----

Another kinda related one that complains about a missing function...
https://community.adobe.com/t5/photoshop-ecosystem-discussions/setting-xmp-isospeedratings-property/...

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
Guide ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
var iso = 0
try {
    var xmp = new XMPMeta(app.activeDocument.xmpMetadata.rawData);
    iso = xmp.iterator(XMPConst.ITERATOR_JUST_LEAFNODES, XMPConst.NS_EXIF, "ISOSpeedRatings").next().value
} catch (e) { }
alert(iso)

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
Advocate ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

Impressively excellent! Thanks so much, jazz-y 🙂

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 ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

So now you need a conditional framework to run the appropriate action, right? If ISO speed = 200 play action XYZ etc.

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
Advocate ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

LATEST

Indeed. I know how to add that.

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