3 Replies Latest reply on Dec 4, 2014 11:45 AM by gkaiseril

    Unable to update the document javascripts, it always remains the original default

    AmiB

      Suddenly starting yesterday, I am unable to update any document Javascripts in my Acrobat Pro XI v11.0.08. Whatever changes I'm trying to apply in the Edit All Javascripts window, after clicking the OK button and reopening that window, the same old original default remains (see below). However when I apply changes to already-existing Javascripts (such that I've created up until 2 days ago) there's no problem changing them. But none can be applied to completely "new" document javascripts. I tried in multiple PDFs and also tried repairing the Acrobat Pro installation, to no avail.

      Here's what always stays put in the Document javascript windows, indifferent to changes:

      //-------------------------------------------------------------

      //-----------------Do not edit the XML tags--------------------

      //-------------------------------------------------------------

       

      Thanks

      Ami

        • 1. Re: Unable to update the document javascripts, it always remains the original default
          gkaiseril MVP & Adobe Community Professional

          Did you read the warning at the top of the screen shoot. Not a good idea to  use "Edit All JavaScripts". If you edit an XML tag you might not be able to recover the code.


          • 2. Re: Unable to update the document javascripts, it always remains the original default
            AmiB Level 1

            Yes, I agree, yet I've only a simple script to add and it's been working well until now. However my problem is that the code won't change at all, always remains that original default.

            • 3. Re: Unable to update the document javascripts, it always remains the original default
              gkaiseril MVP & Adobe Community Professional

              I would never add a script through the "Edit All JavaScripts" but use the most appropriate action to add the script.

               

              Unless you know the appropriate XML tags to enter before you code you not just past code into the section. You need to have XML statements to identify what the JavaScript applies to and mark the end the code. These special coded lines are programmatically generated and need to very specific. I do not think you know the code that needs to be added.

               

              If it is a document level script then "Edit Document JavaScripts" and add the code as needed. For document actions use the "Document Actions" and for fields use the properties for the field.


              For a simple alert when the document is opened the code could look like:

               

              //-------------------------------------------------------------
              //-----------------Do not edit the XML tags--------------------
              //-------------------------------------------------------------

              //<Document-Level>
              //<ACRO_source>MyScript</ACRO_source>
              //<ACRO_script>
              /*********** belongs to: Document-Level:MyScript ***********/
              function MyScript()
              {
              app.alert("Hello world!");
              }

              MyScript();

               

              //</ACRO_script>
              //</Document-Level>

               

              The code around each script is different and not many try to hand code it. That is why you need to use the specific options for editing JavaScript within a PDF.

               

              I am very sure you did not use the "Edit All JavaScripts" to add any code. You must have been using the "Document JavaScripts..." option.