Skip to main content
Luxurynightmares
Known Participant
July 26, 2023
Answered

Is there a way to run a script multiple times in Acrobat?

  • July 26, 2023
  • 1 reply
  • 479 views

Is there a way to repeat a script in Acrobat?

For an example: Lets say I want to make Button1 flash on and off and I write this script on Button2:

 

this.getField("Button1").display = display.hidden;

timer1 = app.setTimeOut('this.getField("Button1").display = display.visible', 1000);

 

When Button2 is pressed, Button1 flashes on and off.  Is there a way to repeat this script?  Let's say I want this script to run 10 times before it stops. 

 

The flashing of the button is not really important, i'm really trying to learn how to make a script run more than once.

This topic has been closed for replies.
Correct answer try67

Yes. Use the setInterval method, instead of setTimeOut.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
July 26, 2023

Yes. Use the setInterval method, instead of setTimeOut.

Luxurynightmares
Known Participant
July 26, 2023

Thank you, appreciate the help.