1 Reply Latest reply on Jul 11, 2008 12:42 AM by Loic.Aigon

    JS metadata CS3 & CS2

    John.Kordas Level 1
      I have a script in CS3 that writes to the documents meta data using:

      myDocument.metadataPreferences.setProperty("http://ns.adobe.com/pdfx/1.3/", "myTitle", myTitle);

      This works fine in CS3 but does not work in CS2.

      if I try:
      app.activeDocument.metadataPreferences.setProperty("http://ns.adobe.com/pdfx/1.3/", "myTitle", "myTitle");

      In the console of ExtendScritp Toolkit I get:

      Result: undefined

      I need to make a CS2 version of this script so if anyone has any suggestions it would be greatly appreciated.
        • 1. Re: JS metadata CS3 & CS2
          Loic.Aigon Adobe Community Professional
          Looking to CS2 & CS3 rererences, the way to define Metadatapreferences is the same.

          MetadataPreference.setProperty (namespace:string, path:string, value:string)

          so it's quite weird.
          Here is a example written by Olav,
          Maybe you can watch for info in it :

          //MetadataExample.jsx
          //An InDesign CS2 JavaScript
          //Adds metadata to an example document.
          var myDocument = app.documents.add();
          with (myDocument.metadataPreferences){
          author = "Olav Martin Kvern";
          copyrightInfoURL = "http://www.adobe.com";
          copyrightNotice = "This document is copyrighted.";
          copyrightStatus = CopyrightStatus.yes;
          description = "Example of xmp metadata scripting in InDesign CS";
          documentTitle = "XMP Example";
          jobName = "XMP_Example_2003";
          keywords = ["animal", "mineral", "vegetable"];
          //The metadata preferences object also includes the read-only
          //creator, format, creationDate, modificationDate, and serverURL
          //properties that are automatically entered and maintained by InDesign.
          //Create a custom XMP container, "email"
          var myNewContainer = createContainerItem("http://ns.adobe.com/xap/1.0/", "email");
          setProperty("http://ns.adobe.com/xap/1.0/", "email/*[1]", "okvern@adobe.com");
          }
          Loic