I just switched over to a Mac from a PC. I used to use AutoHotKey for a keyboard action script, and I'm trying to get this to work on BTT.
I have created a Key Sequence to start a Repeat / For Loop, and it will work. I have it programmed to enter some letters and tab through screens. This needs to repeat continuously though so I can see updates on the screen.
However, occassionally I will need to stop it mid-loop to enter something on a screen.
How can I stop it completely so it ceases all keyboard inputs and I can take immediate control?
Currently, I can get it to stop, but it will only stop once it gets to the end of the loop. It won't stop immediately mid-loop.
So, where would the Cancel Repeat go in the operation?
In the Keyboard Sequence, I have the Start Loop as the first action, then all the actions, then the End Loop action. Would the Cancel Repeat go somewhere in that same action? In the loop sequence? Out of the sequence?
I did name the loop with an identifier. Then I created another keyboard shortcut to Cancel Loop and referenced the identifier of the loop, but that would get it to stop either.
It should go outside of the loop, e.g. some keyboard shortcut.
It might be problematic if your loop is "too busy" and doesn't give BTT a chance to cancel it. You can try adding some small async delay between your actions in the loop to prevent that.
Alternatively you can also add a if condition inside your loop that would cancel / break it when required based on some conditions - there you can also use the "Break Loop" action.
Yes that is possible, in general the async delays are better for most use cases.
The blocking ones basically freeze the whole BTT process - which can be necessary in some situations but usually is not.
I changed all the normal Delays into Async Delays. And, I created a Cancel Repeat keyboard shortcut to cancel that specifically identified loop. However, it's still not stopping it mid-loop. Super odd.
It also stopped looping for some reason too. I have it set to loop 5 times currently, but it's now stopping after 1 loop.
What do you think?
I feel like I'm missing something so simple. . . . .
I added a IF condition to stop the loop if the mouse is moved. That works; however, it still doesn't stop it mid-loop. If finishes the loop and then stops. I need it to stop immediately though.
could you share you trigger/action sequence? Then I could try here
(right-click export to file)
Stopping immediately might however not be possible, the for loop only checks the conditions at the start of an iteration. You could only achieve that by adding ifs before everything you do
At the beginning of the sequence, there is the "Start Repeat / For Loop." Then it runs through various keystrokes. And, then you can see the ending in the picture.
What do you think could be added to make it stop mid-loop?
Here's another development. I deleted the delays and instead entered a "Wait For Key Press" function. This will cycle it through screens, but only after I hit a button to prompt it to move forward. I was trying to automate this function, but this works while I'm trying more options. It doesn't work great though. It will run away from itself occasionally, and I'll have to reset it.
I'll post a picture below of this sequence.
Quick question ----- Can you tell me the exact function of Continue, Cancel, and Timeout? Continue seems obvious, but what does Cancel do? Cancel to where? And what does timeout do and what is the field (seconds, milliseconds)?