Can this be achieved in AP?

Can this be achieved in AP? For example, user clicks and holds down mouse button, a text box counts up in increments of 1, but then after the mouse button has been down for say 2secs the counter jumps to counting up in increments of 5. A further continued press results in counter going up by increments of 10. Is this possible? Please.

Hi Ian,

Yes, you can use JavaScript and variables to do this.
Please see the Execute JavaScript action in the slide On Load event in this sample:
click_hold_count.approj (344 KB)


Thank you I really appreciate this help. The example helps alot in me trying to understand this procedure. However, is there a way to do this without requiring the second click to jump to increments of 5. So say after 2secs, on the first click, then increments jump by 5? Is this possibe?
Again, thank you.

Please describe exactly what you want so that I can make changes to the script at once.

Thank you! I’ll be as clear as I can:
The user presses down on the button, and keeps their finger down (so mousedown stays on the first click through the whole process). The counter starts to count up in increments of 1. While the button is still down, the counter starts to go up in increments of 5 after 2 seconds.
I hope that is clear?
The main thing I am trying to do is the counting up has to be all on the first mousedown.
Thank you so much in advance. I really appreciate your time and help.

So what happens if the button on the first click is still down for a longer time, e.g 10 seconds?
And the second click works the same way as the first one?


Thanks for responding.

If the first click is still down for longer than 10 seconds - It will still continue to count up in increments of 5.

As soon as they release the click (mouse up), then the increment time will be set back to 0. So on second click it will count up first in increments of 1. Then jump to increments of 5 after the button has still been down for longer than 2 seconds.

I hope this makes it clear. Many thanks.


Please see the updated project: click_hold_count_2.approj (344 KB)


Thank you so much - I really appreciate your help and fast responses. This is absolutely perfect. I am so glad this can be achieved in your software. Many thanks.