@azslow3 Thank you so much for taking the time to respond!
Your link to the other thread has inspired me, and I think I understood the timer a little bit better now. However, my new approach has a problem which I don't understand.
I have attached 2 screenshots to show the logic behind the button event, and the feedback for the timer.
My new logic uses recursion to go through the same code 3 times. I also defined a software state used to remember in which state of recursion the execution of the logic is.
Here is a recap of what should happen in short words:1st Loop (Button Press)The software state is not yet initialized, therefore the script only sets focus to track 2, then sets the software state to "1st Loop", calls the timer which sets the software state to "2nd Loop" and calls the logic in recursion.
2nd LoopThe logic sets focus again, then searches and jumps to marker "Part 2". With help of the timer the software state is changed to "3rd Loop", and the logic is called in recursion.
3rd LoopThe logic sets focus again, then selects the clip and sets the loop, which also ends the execution of the logic. This is the jump out of the recursion.
1st Loop and 2nd Loop work exactly as expected. The 3rd Loop however seems not to be executed at all. The clip is not selected, and the loop is not set. Nothing else seems to happen. I feel like the approach has brought me close, but I don't really understand why the 3rd cycle isn't executed. Maybe I misunderstood how the timer works?
If I may ask, would you have an idea what I overlooked here?
*I forgot to mention that the feedback commands visible in the second screenshot are currently identical between both timers.