4 Replies Latest reply on Jul 23, 2009 9:01 AM by bysea

    Scripting for a Button

    pfgenes01

      First of all, I am new to Acrobat and javascript so I don't understand much.  I am wondering if there is a way to count how many times a button is pressed and to record each time one is pressed.  Can this be done through coding?

       

      thanks

        • 1. Re: Scripting for a Button
          Bernd Alheit Adobe Community Professional & MVP

          Post your question only once.

          • 2. Re: Scripting for a Button
            MarkWalsh Level 4

            Depending on how you want it to work, it most likely can be done.

             

             

            The questions arise with what exactly you want it to count:

             

            If you want to tell how many times the button was clicked since the document was opened, then you can increment a variable (add 1 to it) each time the button is pressed. The variable will start at 0 each time the document opens.

             

             

            If you want to tell how many times the button was clicked over the life of the document, then you need to save that variable to a field in the document each time the document closes. This is a bit more work, and may cause problems if it is automatically saving when the end user isn't expecting it.

             

             

            If you want to tell how many times the button was clicked by multiple people using multiple copies of your document, then you would need to save and retrieve the click count from a server. This can be quite a bit more work.

            • 3. Re: Scripting for a Button
              gkaiseril MVP & Adobe Community Professional

              Or track it in an accessable database or 'subscribed global' variable.

              • 4. Re: Scripting for a Button
                bysea Level 1

                Since I'm not a programmer, what would the code look like for such an event? Thanks.