Is there a way to prevent that a macro initiates more at then one at a time?
The situation is this. I want to collect data from the program Pro Tools and i have to use Applescript for this. But System Events in AS and Pro Tools is not a good marriage; it can takes up to 10 seconds before i get data through. It's a known problem and there is no solution found yet. So, i collect this data in the background, and i use the trigger "Focussed Window Changes". But that means that every time i switch window the macro initiates. I could make a manual trigger but that is distracting; data can change and i don't want to think about launching it each time. So, i use the focussed window.
What i tried, is to make a Variable; ThisMacroIsRunning, and cancel the macro when it sees this variable is filled. At the end of the macro i %delete% this variable. But it is buggy; when the macro fails for some reason the "ThisMacroIsRunning" will be filled forever.
So, how else can i make sure a macro instance can only work one at a time?