1 Reply Latest reply on Apr 18, 2012 2:36 AM by kuyseng

    Get XMP exception error 1000 in Mac! but Window is fine?

    kuyseng

      XMP Exception for forum.png

      Below is the function code that write metadata to file and it raise exception when use in Mac:

      -----------

      var setFileProperty = function(propertyObj,file) {

         

          var defaultProperty = {ownerUrl:"", title: file.name, description:"",comments:"", author:"Yoolk Inc.", copyrightNotice: ""}   

          for( var item in defaultProperty){       

              propertyObj[item] = (propertyObj[item]) ? propertyObj[item] : defaultProperty[item];

          };

          if (file instanceof File) {

              if (ExternalObject.AdobeXMPScript == undefined)

                  ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');       

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

              var xmp = xmpFile.getXMP();       

                             

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

              xmp.appendArrayItem(XMPConst.NS_DC, "creator", propertyObj.author, 0, XMPConst.ARRAY_IS_ORDERED);

              xmp.setProperty(XMPConst.NS_DC, "title", propertyObj.title);    //it's error when title have value

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

              xmp.setLocalizedText( XMPConst.NS_DC, "description", null, "x-default", propertyObj.description);        

             

              // write updated metadata into the file

              if (xmpFile.canPutXMP(xmp)) {

                  xmpFile.putXMP(xmp);

              }

              xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);

          }

      };

      ---------

      I have read this http://forums.adobe.com/message/2225492

      And the answer is file is already opened or being edited from another place.

      For me, it seem not that anwser because my script export new image file then write metadata to that new file. So it's impossible that file is already opened or being edited from another place..

      Do everyone have any comment about that? Please help to share it!!      Thank in advance!!