Why App Window Not in Front When → Display 2?

Why app window not in front when → display 2 ?

The task:

Open new BusyCal window Display2 Macro (v10.2)

Only when I click on the app icon in the dock does it come to the front. Option "All WIndows" or "Desktop on Display 2" doesn't matter, app window does not pop up.

I've looked into @_jims " MACROS: Desktop Spaces • Macros to Improve Navigation and Window Management, v1.1" .

My Display D2 is Desktop (Space) on a secondary display (iMac 2015) used by the Mac Mini 2.

I only want the app window come to the front, that's all :slight_smile:

Open new BusyCal window D2.kmmacros (7.2 KB)

Hey Omar,

Unfortunately I don't have the means to test this at the moment, but if I'm understanding the problem correctly...

Apple has provided no public APIs for Spaces, so Keyboard Maestro is unable to manage them.

What happens is basically up to the system.


Yes, the missing API, but

if I could add another step to the macro, → physically (or better otherwise) imitating a click on the app (BusyCal) in the Dock would do it. But how?


Have you tried a click in a blank area of the menu bar of Display 2 to activate that Space?

And do you actually need Display 2 to be its own Space? If not, turn the option off in System Settings -- problem (probably) solved!

In Sys Prefs, I unchecked "When switching to an application, switch to a Space with open windows for the application."
→ this allowed BusyCal to appear on display 2 !

(This was not necessary to do for the macro for Safari, TextEdit … to work.)

Thanks Nige_S !

You can do something like this:

tell application "System Events"
   tell application process "Dock"
      tell list 1
         tell (first UI element whose name is "Mail")
            perform action "AXPress"
         end tell
      end tell
   end tell
end tell

Hey Chris,
Very useful, thank you! :+1:

1 Like