bashapplescriptapple-expose

Open an application in a space using applescripts


I am trying to create a script that will open an application in a specific "space". So let's say I am on space 1 working in the terminal and then I want to be able to open safari in space 4. Is there a way to do this?

I have done some searching and found only ways to set the system profile options. Maybe I should tell you my end goal in case what I am attempting is not possible.

I use a laptop and plugin in to multiple stations, home, office, and travel. I want to create different window layouts for each one. So I will need an apple script telling it to open applications in varios spaces and different dimensions. I hope this makes sense. Ask me for clarification if it doesn't thanks!

PS the answer doesn't necessarily have to be any applescript I just thought that would be the easiest way :)


Solution

  • It is possible to do some scripting of application Space preferences by using the scripting interface to the System Events.app. See the answer to a similar question here.