Register the times a translator has been triggered. CMD+TAB functionality on windows (not apps). MacOS related

Hi! MacOS user here.

Is it possible to somehow create a global variable and increase its value with every translator trigger? If it’s possible, can I use this variable in an outgoing applescript action?

I’d like to achieve the same functionality CMD+TAB has, but with windows, not apps. In other words, I’d like to either:
→ cycle between windows (if I hold COMMAND down between each backtick key press) or
→ toggle between two windows (if I release COMMAND between each backtick key press).

Any reply is appreciated. Thanks in advance!

Hi, well you could do it with incoming MIDI but not a computer keystroke. The reason for this is the original computer keystrokes you type are not suppressed so they will still function as MacOS handles them natively.

So with any incoming MIDI message you can trigger an AppleScript to perform a given function.

As far as setting number of incoming triggers, you would set up a global variable as a counter and in every translator rules, you would increment the variable.

For instance is you use ‘ga’ as a counter, you would have the rule below in every translator:

ga=ga+1

Then you could use the value of ga in your AppleScript.

I hope this helps!

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz
1 Like

This was the piece I was missing. Thank you!

Also, can BMTP execute an absolute value function? In other words, is it possible to make the ‘ga’ global variable have 1 and 0 values alternatively? First execution ‘0’, second execution ‘1’. Modifying ‘ga’ from the applescript outgoing action doesn’t seem to work…

If the value of ga is equal to 0, the below rule, will toggle the value between 0 and 1

ga=ga^1

This is an exclusive OR operator so what it does is it compares the current takes the current value and swaps it. It is a bitwise operator so in this case it works only on bit 0 of 32 bits.

See this post on bitwise operations.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz
1 Like

MacOS system Settings lets you:
. cycle between windows of the same app with the shortcut you want
. cycle between all the opened windows of all opened apps with another shortcut you want

I suggest you to use BetterTouchTool app for doing things like this easily (and 1 milion things more)

Thanks for the suggestion. Does this app have global variables like MT?

Yes, you can create all variables you want in BTT, and call it as you want,.
You can download a trial of the app with full functionality before buying.
The forum of BTT is very useful with any doubt you can have.

You could also look into Keyboard Maestro.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

@jordikt and @SteveC, thank you for your suggestions, but for now MT will do.