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

Get userComment details from Metadata?

Engaged ,
Nov 30, 2016 Nov 30, 2016

Copy link to clipboard

Copied

Hi

Is this possible to get userComment details from Metadata?

I tried this code is not working properly. Kindly anyone suggests me to solve this problem.

var xmpString = app.activeDocument.xmpMetadata.rawData;

var flg = xmpString.match(/<exif:UserComment>(\w)<\/exif:UserComment>/);

var xmpString = app.activeDocument.xmpMetadata.rawData;

var comment = xmpString.getProperty( XMPConst.NS_EXIF, "userComment" );

Screen Shot 2016-11-30 at 5.25.10 pm.png

-yajiv

TOPICS
Actions and scripting

Views

686

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 , Nov 30, 2016 Nov 30, 2016

Please try this...

#target photoshop

if(documents.length){

if (ExternalObject.AdobeXMPScript == undefined)  ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");

var userComment='';

xmp = new XMPMeta( app.activeDocument.xmpMetadata.rawData );

if( xmp.doesPropertyExist(XMPConst.NS_EXIF, "UserComment" ) ){

userComment = xmp.getLocalizedText(XMPConst.NS_EXIF, "UserComment", null, "en");

}else{

  userComment = "No user comment";

  }

alert(userComment);

}

Votes

Translate

Translate
Adobe
Guide ,
Nov 30, 2016 Nov 30, 2016

Copy link to clipboard

Copied

Please try this...

#target photoshop

if(documents.length){

if (ExternalObject.AdobeXMPScript == undefined)  ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");

var userComment='';

xmp = new XMPMeta( app.activeDocument.xmpMetadata.rawData );

if( xmp.doesPropertyExist(XMPConst.NS_EXIF, "UserComment" ) ){

userComment = xmp.getLocalizedText(XMPConst.NS_EXIF, "UserComment", null, "en");

}else{

  userComment = "No user comment";

  }

alert(userComment);

}

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
Engaged ,
Nov 30, 2016 Nov 30, 2016

Copy link to clipboard

Copied

LATEST

Hi SuperMerlin!

This script is working like a charm.....

-yajiv

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