Skip to main content
Known Participant
August 2, 2025
Answered

UI button to stop loop - Automation Blocks

  • August 2, 2025
  • 2 replies
  • 486 views

Hello all,

 

Is it possible to create a UI button to stop the loop in Automation Blocks?

 

- I have tried it with "repeat while + input of type checkbox"

- I also tried it with "repeat while true" and inside the loop I put an IF statement with "input of type checkbox" and inside a "break out of loop". 

 

I was hoping with the second method the state of the checkbox would get evaluated during each loop, which would be PERFECT, but unfortunately that didn't work either.

 

Any help or advice would be greatly appreciated.

Correct answer Mathias Moehl

Could you please implement a button next to the "Run" button, which is a "Stop" button? 

That would solve this problem perfectly.


Unfortunately not! There is no way to stop a script via Premiere Pro's scriptinng engine. Hence, also Automation Blocks cannot do that, unfortunately. Here I am limited by what the scripting engine itself is capable of.  

2 replies

Henrique - TMMW
Participating Frequently
August 9, 2025

Hi @GEdit 

 

Henrique here from TMMW.

I had to implement a similiar solution for a client and the workaround was

checking for a file in the system and using that to stop the loop.

 

Feel free to reach out.

henrique@themachinemustwork.com

 

Henrique \ TMMW
Mathias Moehl
Community Expert
Community Expert
August 2, 2025

UI values are read before the script is executed and then inserted into the code as constants. So there is no way to interactively stop the script with a UI element. The best hack I could think of is creating some file or folder on your harddrive and make the loop check if the file still exists and stop otherwise. Then you can at least force-stop the loop by deleting the file.

You should also be able to add a confirm popup dialog  after each round of the loop (or say every 100 loops), like "do you still want to continue?"

For stopping scripts see also
https://community.adobe.com/t5/after-effects-discussions/automation-blocks-is-there-a-way-to-force-stop-a-script/m-p/14363910

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
GEditAuthor
Known Participant
August 3, 2025

Thank you for your reply Mathias.


Would it be possible to create a block that evaluates (the checkbox value) at every loop?

Mathias Moehl
Community Expert
Community Expert
August 3, 2025

No, there is no way to access the input values dynamically at runtime.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects