Applescript won't open applications on my external monitor

Posted by jpadvo on Super User See other posts from Super User or by jpadvo
Published on 2014-06-02T20:31:13Z Indexed on 2014/06/02 21:31 UTC
Read the original article Hit count: 165

I'm trying to open a new MacVim window with Applescript, and have found partial success with this:

do shell script "cd \"~/code/application\"; ~/bin/mvim > /dev/null 2>&1"

This works fine, and opens a new MacVim window with it's working directory set to ~/code/application. BUT it always opens on the screen of my laptop, not on the external monitor with the currently active space where I am working.

Is there a way to get MacVim to open in the current space?

Edit: same problem with opening a finder window:

tell application "Finder" to make new Finder window

© Super User or respective owner

Related posts about multiple-monitors

Related posts about applescript