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

JS metadata CS3 & CS2

Explorer ,
Jul 10, 2008 Jul 10, 2008
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.
TOPICS
Scripting
1.4K
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 ,
Jul 11, 2008 Jul 11, 2008
LATEST
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
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