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

Enthusiast ,
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

56

Likes

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

Adobe Community Professional , 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)

Likes

Translate

Translate
Enthusiast ,
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/...

Likes

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
Adobe Community Professional ,
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)

Likes

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

Copy link to clipboard

Copied

Impressively excellent! Thanks so much, jazz-y 🙂

Likes

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
Adobe Community Professional ,
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.

Likes

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

Copy link to clipboard

Copied

LATEST

Indeed. I know how to add that.

Likes

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