2 Replies Latest reply on Sep 26, 2012 8:12 AM by Gonterman1201

    Problems writing metadata.

    Gonterman1201 Level 1

      Just when I thought I had this working i was wrong. What is happening is I have a custom schema loaded on one file. If i load it on that one file Indesign remembers it and my script works fine. If it is not loaded things go wrong. I need this to happen through the script not loading from inDesign.

       

      Heres the basics.

       

      var myDocument=app.activeDocument;
      var myJobNum=myDocument.name.slice(0,5);
      var myPoo=myDocument.metadataPreferences;
      with (myPoo){
                  if (ExternalObject.AdobeXMPScript == undefined) {
                  ExternalObject.AdobeXMPScript = new
                  ExternalObject("lib:AdobeXMPScript");
                  }
      
      
                  xmp = new XMPMeta();
      
                  var myNewColor=setProperty("http://www.hjedesign.com/metadata/1.0/", "color", selectedColor,);
                  var myNewYear=setProperty("http://www.hjedesign.com/metadata/1.0/", "year",  selectedYear,);
                  var myNewSize=setProperty("http://www.hjedesign.com/metadata/1.0/", "trimSize", selectedSize,);
                  var myNewSize=setProperty("http://www.hjedesign.com/metadata/1.0/", "specialInstructions", selectedInst,);
              }
      

       

      wich work fine when that custom schema has been loaded but does not work at all if i don't. If i try to setProperty it tells me i have and unregistered schema.