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

**URL:** <https://forum.bome.com/t/register-the-times-a-translator-has-been-triggered-cmd-tab-functionality-on-windows-not-apps-macos-related/5578>\
**Category:** Bome Products\
**Tags:** midi-translator\
**Created:** [October 23, 2023, 5:17pm UTC](https://forum.bome.com/t/register-the-times-a-translator-has-been-triggered-cmd-tab-functionality-on-windows-not-apps-macos-related/5578 "2023-10-23T17:17:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![alin.catana](https://forum.bome.com/user_avatar/forum.bome.com/alin.catana/32/4878_2.png) [@alin.catana](https://forum.bome.com/u/alin.catana)\
**Post date:** [October 23, 2023, 5:17pm UTC](https://forum.bome.com/t/register-the-times-a-translator-has-been-triggered-cmd-tab-functionality-on-windows-not-apps-macos-related/5578/1 "2023-10-23T17:17:27Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [October 23, 2023, 9:49pm UTC](https://forum.bome.com/t/register-the-times-a-translator-has-been-triggered-cmd-tab-functionality-on-windows-not-apps-macos-related/5578/2 "2023-10-23T21:49:20Z")

</div>

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_

---

<div class="post-metadata">

**Author:** ![alin.catana](https://forum.bome.com/user_avatar/forum.bome.com/alin.catana/32/4878_2.png) [@alin.catana](https://forum.bome.com/u/alin.catana)\
**Post date:** [October 24, 2023, 5:42am UTC](https://forum.bome.com/t/register-the-times-a-translator-has-been-triggered-cmd-tab-functionality-on-windows-not-apps-macos-related/5578/3 "2023-10-24T05:42:32Z")

</div>

> [@SteveC](#):
>
> For instance is you use ‘ga’ as a counter, you would have the rule below in every translator:
> 
> ga=ga+1

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…

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [October 24, 2023, 2:36pm UTC](https://forum.bome.com/t/register-the-times-a-translator-has-been-triggered-cmd-tab-functionality-on-windows-not-apps-macos-related/5578/4 "2023-10-24T14:36:11Z")

</div>

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](https://forum.bome.com/t/bitwise-operations-and-reference/1862) on bitwise operations.

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![jordikt](https://forum.bome.com/user_avatar/forum.bome.com/jordikt/32/2878_2.png) [@jordikt](https://forum.bome.com/u/jordikt)\
**Post date:** [October 27, 2023, 11:56am UTC](https://forum.bome.com/t/register-the-times-a-translator-has-been-triggered-cmd-tab-functionality-on-windows-not-apps-macos-related/5578/5 "2023-10-27T11:56:06Z")

</div>

> [@alin.catana](#):
>
> → cycle between windows (if I hold COMMAND down between each backtick key press)

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

> [@alin.catana](#):
>
> → toggle between two windows (if I release COMMAND between each backtick key press).

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

---

<div class="post-metadata">

**Author:** ![alin.catana](https://forum.bome.com/user_avatar/forum.bome.com/alin.catana/32/4878_2.png) [@alin.catana](https://forum.bome.com/u/alin.catana)\
**Post date:** [October 28, 2023, 4:39am UTC](https://forum.bome.com/t/register-the-times-a-translator-has-been-triggered-cmd-tab-functionality-on-windows-not-apps-macos-related/5578/6 "2023-10-28T04:39:51Z")

</div>

> [@jordikt](#):
>
> 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?

---

<div class="post-metadata">

**Author:** ![jordikt](https://forum.bome.com/user_avatar/forum.bome.com/jordikt/32/2878_2.png) [@jordikt](https://forum.bome.com/u/jordikt)\
**Post date:** [October 28, 2023, 12:06pm UTC](https://forum.bome.com/t/register-the-times-a-translator-has-been-triggered-cmd-tab-functionality-on-windows-not-apps-macos-related/5578/7 "2023-10-28T12:06:33Z")

</div>

> [@alin.catana](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [October 28, 2023, 12:32pm UTC](https://forum.bome.com/t/register-the-times-a-translator-has-been-triggered-cmd-tab-functionality-on-windows-not-apps-macos-related/5578/8 "2023-10-28T12:32:35Z")

</div>

You could also look into Keyboard Maestro.

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![alin.catana](https://forum.bome.com/user_avatar/forum.bome.com/alin.catana/32/4878_2.png) [@alin.catana](https://forum.bome.com/u/alin.catana)\
**Post date:** [October 28, 2023, 1:55pm UTC](https://forum.bome.com/t/register-the-times-a-translator-has-been-triggered-cmd-tab-functionality-on-windows-not-apps-macos-related/5578/9 "2023-10-28T13:55:44Z")

</div>

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