Open application in specific space through AppleScript

I have a script that I run when I get to work to open all of the applications that I work with. But when I run it they all open in one space. I'm running OSX Yosemite 10.10.3.

So I need an AppleScript that will make new spaces if needed and then open the applications in specified spaces.


Solution 1:

If you lock an app to a space it will always open in that space, no script required. the limitation is that all windows of each app will be in the same space; no way round that except manually, afaik.

First open the app in the required Space, then right click the Dock icon & select 'This Desktop'
After that, if you check from any other Space you will see the Space number listed.

[& I do wish they'd stop calling them Desktops]

enter image description here

If you really need it to be scripted, then this MacScripter page has all the calls - http://macscripter.net/viewtopic.php?id=23453