Copy link to clipboard
Copied
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.
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.
Copy link to clipboard
Copied
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-s...
Copy link to clipboard
Copied
Thank you for your reply Mathias.
Would it be possible to create a block that evaluates (the checkbox value) at every loop?
Copy link to clipboard
Copied
No, there is no way to access the input values dynamically at runtime.
Copy link to clipboard
Copied
Could you please implement a button next to the "Run" button, which is a "Stop" button?
That would solve this problem perfectly.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now