Hi, would it be possible to add the system language as an option in the conditions?
I have BTT on two Macs with synchronized settings. One is set to English, while the other is set to Czech. I’d like to set up a single trigger with a condition that detects the system language and then calls the corresponding menubar-item. One trigger performs the same function, but the menu item is of course named differently in each language. Thanks.
For the trigger menu bar menu item action you might not need this as it allows to specify alternatives.
File||Datei;New Window||Neues Fenster
For example this would trigger File => New Window in english and Datei => Neues Fenster in German:
Alternatively you can use the "If JavaScript returns true" with such a script:
async function languageIsEnglish() {
const result = await runShellScript({script: "defaults read -g AppleLanguages"})
const languages = [...result.matchAll(/"([^"]+)"/g)].map(m => m[1]);
const firstLanguage = languages[0];
return firstLanguage === "en-US";
}
The first option using || works perfectly. It didn't occur to me to use a logical operator. Thanks a lot.