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

metadata description writer via script

Explorer ,
Jan 29, 2015 Jan 29, 2015

any snippet that will let me insert my name automatically into the file info under "description writer"

ie...

  copyrightNotice = "© 2015 XXXXX";


scott

TOPICS
Scripting
2.0K
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

correct answers 1 Correct answer

Community Expert , Jan 30, 2015 Jan 30, 2015

"Yes" on what question, please?

copyrightNotice is part of the changeable metadata:  Adobe InDesign CS6 (8.0) Object Model JS: MetadataPreference

but "description writer" is not. Possibly there is such a field in a PDF's metadata but not all can be written as easily -- see the link for the fields that can.

Translate
Community Expert ,
Jan 29, 2015 Jan 29, 2015

Changing metadata through a script is easy (search this forum for examples), but what do you mean with "automatically"? When the script is run? For all new documents? Right before you save a document?

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
Explorer ,
Jan 30, 2015 Jan 30, 2015

yes---but i am unable to find the proper wording to insert information in "description writer" area of the metadata

scott

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
Community Expert ,
Jan 30, 2015 Jan 30, 2015

"Yes" on what question, please?

copyrightNotice is part of the changeable metadata:  Adobe InDesign CS6 (8.0) Object Model JS: MetadataPreference

but "description writer" is not. Possibly there is such a field in a PDF's metadata but not all can be written as easily -- see the link for the fields that can.

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
Explorer ,
Jan 30, 2015 Jan 30, 2015

yes was to changing metadata is easy. thanks for confirming what i was afraid of...that "description writer" was not editable via script

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
People's Champ ,
Feb 02, 2015 Feb 02, 2015

Hi all,

What about the XMP Library documented in the JavaScript Tools Guide CC pdf file. It allows you to reach files inner XMP metadata. Then you can edit metadata outside the InDesign Object Model.

I use it in many scripts.

Unless I misunderstood something ?

Loic

http://www.ozalto.com

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
Community Expert ,
Feb 02, 2015 Feb 02, 2015

Loic, can you write up an example? I'm only familiar with the immediately accessible parts of PDFs.

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
People's Champ ,
Feb 02, 2015 Feb 02, 2015

Hi Jongware,

Sure !

if (ExternalObject.AdobeXMPScript == undefined) {

  ExternalObject.AdobeXMPScript = new

  ExternalObject('lib:AdobeXMPScript');

}

var f = File ( Folder.desktop+"/toto.pdf" );

var xmpFile = new XMPFile(f.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);

var xmp = xmpFile.getXMP();

xmp.deleteProperty(XMPConst.NS_DC, "rights");

xmp.appendArrayItem(XMPConst.NS_DC, "rights", "This is how I rule the world", 0,XMPConst.ARRAY_IS_ORDERED);

if (xmpFile.canPutXMP(xmp)) {

xmpFile.putXMP(xmp);

}

xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);

Capture d’écran 2015-02-02 à 16.56.51.png

No merits here, just copy/pasted the doc

I think Marijan also did great posts on his blog on this topic.

Loic

http://www.ozalto.com

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 ,
Feb 02, 2015 Feb 02, 2015
LATEST

Hello,

did you mean this entry?

var _docXMP = app.activeDocument.metadataPreferences,

    _destNamespace = "http://ns.adobe.com/photoshop/1.0/",

    _destNodeName = "CaptionWriter",

    _nodeValue = "Roland";

_docXMP.setProperty(_destNamespace, _destNodeName, _nodeValue);

$.writeln(_docXMP.getProperty(_destNamespace, _destNodeName));

Roland

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