how to open and move an app silently through 'exec-and-forget' #1538
Unanswered
he-linyun
asked this question in
questions-and-answers
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I have a probably fundamental question on writing key-bindings using 'exec-and-forget'. My goal is to define a key-binding that first opens up several apps and then switches my focus to a specific workspace. This is my function (in service mode)
As you can see from the script, I intend to focus on my "Calendar" workspace. However, every time I use the key-binding, I ended up looking at my Obsidian app (which lives in an "Obsidian" workspace).
I searched up a little bit and ChatGPT tells me that this is because I have another script
such that when aerospace creates and moves the Obsidian app to its desired workspace, the system will adjust the focus. But I am confused that, when I run
open -g -a Obsidian
in a terminal, obsidian can be invoked and sent silently to its desired workspace--while I am still focusing on the terminal (NOT in theObsidian
workspace).Could anybody explains why we have these inconsistencies (at least to me)? And possibly workarounds? I also met another problem on 'exec-and-forget osascript -e 'quit app "Visual Studio Code"'' which would raise an error.
My whole config file is
Beta Was this translation helpful? Give feedback.
All reactions