MacOS – AppleScript: Open a new window in current space without switching to active window in another space

applescriptmacmacosspace

I want to have an application open a new window in the current space without switching to a space in which a window is already open, but I want to keep the

When switching to an application, switch to a space with open windows
for the application

setting in System Preferences > Mission Control.

In other words, I want to tell an application to open a new window directly, without first telling it to activate.

How can I do this with AppleScript (if possible)?

Best Answer

Mission Control is not scriptable as far as I am aware. Its actually one of things that Apple needs to correct in hindsight. I've been wanting to make a app that sets up my workspace and gets it ready for work for a week now.