1 Reply Latest reply on Jul 19, 2016 1:51 AM by jessevic

    How to remove the "Author" value and write a new author name

    jessevic

      Hello,

       

      I'm a dummy with scripting. I hope some experts can help me.

      I'm working with FM11 and extendscript.

       

      Now we have to insert metadata into the file info like "Author", "Title", "Keywords",....

      As far I found the way to do it!

       

      #target framemaker

       

      var doc = app.ActiveDoc; 

      var info = doc.PDFDocInfo;

      var doctype = prompt("Possible cases: Installation manual, Operation manual, Installation and operation manual, Installer reference guide, User reference guide, Installer and user reference guide","Installation manual","Please input the type of manual");

      info.push ("Author"); 

      info.push (doctype); 

      doc.PDFDocInfo = info;

       

       

      Imagine that I run the script again, fill in a new entry in the inputbox, then the new entry does NOT overwrite the existing entry in the FM document.

      Can somebody tell me (in dummy javascript language and step-by-step), how I can solve this issue for me?

       

      Kind regards

        • 1. Re: How to remove the "Author" value and write a new author name
          jessevic Level 1

          This is the solution!

           

           

          var doc = app.ActiveDoc;

          var info = doc.PDFDocInfo;

          var info=new Strings();

          var doctype = prompt("Possible cases: Installation manual, Operation manual, Installation and operation manual, Installer reference guide, User reference guide, Installer and user reference guide","Installation manual","Please input the type of manual");

          info.push ("Author"); 

          info.push (doctype); 

          doc.PDFDocInfo = info;

           

          As test I wrote something in the Author field, I re-run the script and put another value into the inputbox. Result is that the original/wrong entry was deleted and/or overwritten with the new one.