jawk4
September 23, 2024, 6:17pm
1
Hi, here's what I'm trying to accomplish:
A single hotkey to open a new Chrome tab with the correct profile
If I'm viewing Space #1 , use my personal profile
Otherwise, use my work profile
Is there a way for BTT to detect which Space is currently active? Or does anyone have another suggestion for how to accomplish this?
Thanks!
In the latest alpha (4.725) I added a on-demand variable "ActiveSpace" for this, you can e.g. use it in an if condition.
async function someJavaScriptFunction() {
let activeSpace = get_number_variable("ActiveSpace");
if(activeSpace == 4) {
return true
}
return false;
}
Note: the space id is not equivalent to what the space is called in the macOS UI.
jawk4
October 2, 2024, 4:17am
3
Hi Andreas — that's great, thank you! I'll try it.
jawk4
October 28, 2024, 8:23pm
4
Worked perfectly! Thank you.
Here's what I'm doing. Looks like my first space has the ID of 3. Happily, this persists across restarts.
async function isPersonalSpace() {
return await get_number_variable("ActiveSpace") == 3;
}
uzo
September 9, 2025, 11:58am
5
Is there a way to get the number of the desktop (space) into a floating menu (the text of the menu)?
I didnt find the way to do it so far.
tried this
thank you
In 5.599 alpha I made the active_space and translated_active_space variables observable. This means you can now do this without any scripting (just put it in curly braces - e.g. {translated_active_space}):
I also added a new "Active Space Did Change" trigger.
uzo
September 9, 2025, 3:00pm
7
thank you very much, this solves my biggest issue with macos and that is knowing what space im in ( according to various forums, many other users struggle with this too).