5 Replies Latest reply on Aug 14, 2015 6:26 AM by try67

    Deselect existing checkbox

    vin22 Level 1

      Hello,

       

      I am new to Javascript for Acrobat programming.

       

      I have a standard Acrobat tool window (Acrobat XI) that has some checkbox checked by default. I would like to add a javascript that deselect automatically those checkbox.

      Is there a way I can get a reference and access the 'standard' checkbox and perform actions on them?

       

      Thank you

        • 1. Re: Deselect existing checkbox
          try67 MVP & Adobe Community Professional

          I don't know what you mean by a "standard" check-box, but assuming it's a form field you can access it using the getField method, and then set its value to "Off" to de-select it. Something like this:

           

          this.getField("FieldName").value = "Off";

          • 2. Re: Deselect existing checkbox
            vin22 Level 1

            I mean that it is a checkbox of Acrobat UI interface, it is inside one of the Acrobat tool window. So it is not a custom form field.

            This is why I don't know how to get the 'fieldName' related to that checkbox

             

             

            Or, as alternatives, If I create an Action from the Action Wizard, is it possible to activate that custom action from Javascript?

             

            Thanks

            • 3. Re: Deselect existing checkbox
              try67 MVP & Adobe Community Professional

              The check-boxes in the Acrobat GUI are not something you can access with a script, although some specific settings (very few) can be. If you specify what you want to do I could tell you if it's scriptable, but the chances are it's not.

               

              I don't see how it's related to your first question, but no, you can't run an Action from a script.

              • 4. Re: Deselect existing checkbox
                vin22 Level 1

                I would like to activate the remove hidden tools with a single UI itneraction, and I need to select only few 'hidden' elements to remove.

                 

                If I create my custom action I can assign it to the toolbar but then I have to interact with the toolbar at first and then with the new opened window to start the action.

                If I use javascript to automatically open the "RemoveHiddenInfo" Menu I would be able to activate the function pressing only the 'remove' button. The problem is I have to manually disable the checkbox of the elements I don't want to remove (because by default all checkbox are selected)

                • 5. Re: Deselect existing checkbox
                  try67 MVP & Adobe Community Professional

                  The closest you can get to it is to open the Remove Hidden Information pane and have it search the current document (the same as clicking the button under Tools - Protection). After that you'll have to continue manually.

                   

                  However, you can include this command in an Action and set it to remove the specific items you want to remove, and then run that Action on your files. No script required...