Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)?

share|improve this question

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.

share|improve this answer

This is as close as I could get...

set APP_TO_OPEN to "Dictionary"

do shell script "/Applications/Mission\\\\ Control"
delay 0.5
tell application "System Events" to tell process "Dock"
    set countSpaces to count buttons of list 1 of group 1
    click button 1 of group 1
    repeat until (count buttons of list 1 of group 1) = (countSpaces + 1)
    end repeat
    click button (countSpaces + 1) of list 1 of group 1
end tell
delay 0.5
do shell script "/Applications/Mission\\\\ Control 1"
tell application APP_TO_OPEN to activate
share|improve this answer
What do you mean by "as close as"? What does work, what doesn't? – patrix Sep 9 '15 at 5:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.