ASObjC Runner question

Does ASObjC Runner “know” which of two screens on a Maverick machine has the focus, i.e., has the bright menu bar. I’m assuming that Screen 1 is the internal screen on my iMac and Screen 2 is the external screen.

Normally this is accomplished by simply clicking on the “other” screen, but I want to use it as part of a script to make sure a dialog arrives on the internal screen.

Not necessarily. The documentation for the underlying API hasn’t changed with 10.9, and it says the first screen is “the screen that contains the menu bar and whose origin is at the point (0, 0)”. I suspect that in 10.9 “contains the menu bar” means contains the active menu bar, but the bit about the origin of {0, 0} doesn’t seem to apply any more.

I’d try:

	screen 1 whose main screen is true

or:

	screen 1 whose has menu bar is true

If you know your screen arrangement, you can also work it out from the bounds.

(I just upgraded my external monitor to the same size as my iMac’s, so it’s a bit harder to tell one form the other in my tests.)

Thanks, Shane. For my purposes, “has menu bar of screens” as a test does it, because item 1 is always the internal screen, item 2 is the external screen and item 3 is the composite screen (both together).

Now the real problem: how to switch it from a script.

You can use “set has menu bar of screen 2 to true”, although it still does the full animation thing. I should remove that for Mavericks…

Not only does it do the whole animation thing, it reverses the window content of the two screens along with with the active menu bar. I’m suspecting that Maverick needs a little work in this regard.

Yep. what happens if you set a screen’s main screen property to true?

On my machine any attempt to set main screen of screen n to true or false errors no matter which screen the script is on. I mention that last part because the behavior of “has menu bar” does depend on which screen the script itself is on.

It doesn’t look like much can be done until the APIs are updated.

Thanks for the suggestions in any case – they at least show that the APIs didn’t come along for the ride in Maverick.