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

Metadata and extensions.

Contributor ,
May 30, 2013 May 30, 2013

I want to write metadata to any file. Is that possible?

And what about folders, can I write metadata to a folder?

Could any one help me by modifying this js code snippet to acheive that:

app.synchronousMode = true;

var pathToLib = Folder.startup.fsName + "/AdobeXMPScript.framework";

var xmpLib = new ExternalObject ("lib:" + pathToLib);

var thumb = app.document.selections[0];

var myFile = thumb.spec;

var myXmpFile =  new XMPFile(myFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);

var myXmp = myXmpFile.getXMP();

myXmp.setLocalizedText( XMPConst.NS_DC, "title", null, "x-default", "Some Text");

var updatedPacket = myXmp.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT);

thumb.metadata = new Metadata(updatedPacket);

myXmpFile = new XMPFile (myFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ);

myXmp = myXmpFile.getXMP();

var myTitle = myXmp.getProperty (XMPConst.NS_DC, "title[1]");

$.writeln (myTitle +"");

app.synchronousMode = false;

Thanks for any one read this, and much thanks for any answer.

TOPICS
Scripting
554
Translate
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
Contributor ,
May 30, 2013 May 30, 2013
LATEST
Translate
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