Not able to bring a window to front

Hey all,

I’m running Nuendo (a music application) and there is a child window called “Video Player”. I’m desperately trying to
bring that window to front, but it’s not possible. It’s as if Keyboard Maestro cannot se it. Also iterating thru the windows via WINDOWCOUNT() does not work. Any other ideas, what I could try?

Hey Stevie,

Chances are that Keyboard Maestro CAN’T see it.

Keyboard Maestro will only see normal system windows – not palettes or dialogs or certain other windows.

Open your app with the Video Player window open.

Run this AppleScript from the Script Editor.app.

/Applications/Utilities/Script Editor.app

tell application "System Events"
   tell application process "Nuendo"
      properties of windows
   end tell
end tell

Look in the Result Panel and post the text you see.

Chances are pretty good that System Events will see your window, but we won’t know if it can be manipulated until we test.

-Chris

Hey Chris!

Thanks for your help, much appreciated.

I run the script and here are the results:

{{minimum value:missing value, orientation:missing value, position:{0, 45}, class:window, role description:"Fenster", accessibility description:missing value, focused:false, title:"", size:{1920, 1031}, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:"AXWindow", entire contents:{}, subrole:"AXUnknown", selected:missing value, name:missing value, description:"Fenster"}, {minimum value:missing value, orientation:missing value, position:{0, 23}, class:window, role description:"Standardfenster", accessibility description:missing value, focused:false, title:"Nuendo 7.1 Project - Untitled1", size:{1920, 1053}, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:"AXWindow", entire contents:{}, subrole:"AXStandardWindow", selected:missing value, name:"Nuendo 7.1 Project - Untitled1", description:"Standardfenster"}}

Does not look too good to me :fearful:

That's how the GUI looks:

If nothing else, here’s a couple of possible solutions.

  1. See if ` Brings it to the front.
  2. Use a Click on Found Image action to look for the window’s title, possibly including the three buttons at the left of the title bar.
  3. If the window always comes up in the same location, just have the macro click that location.
  4. I doubt this will work, but see if you can Tab to the window.
  5. I’m sure you’ve done this, but verify that there isn’t a keyboard shortcut or menu item that focuses the window.

Hey Dan!

Thanks for your reply.

  1. ⌘ ` works, but not for the video window, it works for another child window (mixconsole). This video window seems burried somewhere in the code as independent window.

  2. that’s a great idea and I really think that might be the only solution!

  3. That’s the problem, my script is actually about resizing the window in 3 different states, So I have 3 different locations

  4. This indeed didn’t work :confused:

  5. Right, that’s not the case, however F8 toggles the window. Another solution would be to press F8 twice, because after enabling the video window it is also focused.

Thanks for your great input!

Glad to help. I automate Final Cut Pro X, and the number of hoops I have to jump through to get things to work is astronomical! Totally worth it, but still, I spend a lot of time scratching my head and thinking “OK, that didn’t work, what else can I try?” :slight_smile:

Hey Stevie,

Me neither...

But some apps hide some of their windows when they're not frontmost.

tell application "System Events"
   tell application process "Nuendo"
      set frontmost to true
      delay 0.25
      properties of windows
   end tell
end tell

Make sure your video window is open in Nuendo and run this. See if there is a difference in the result.

If so then post it.

-Chris

Good call. For example, I know Final Cut Pro X does that with its Keywords window, and it drove me crazy for a while!

Holy Macaroni! Now that worked!

Here are the results:

minimum value:missing value, orientation:missing value, position:800, 795, class:window, role description:Schwebefenster, accessibility description:missing value, focused:true, title:Video Player, size:480, 286, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXWindow, entire contents:, subrole:AXFloatingWindow, selected:missing value, name:Video Player, description:Schwebefenster, minimum value:missing value, orientation:missing value, position:0, 45, class:window, role description:Fenster, accessibility description:missing value, focused:false, title:, size:1920, 1031, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXWindow, entire contents:, subrole:AXUnknown, selected:missing value, name:missing value, description:Fenster, minimum value:missing value, orientation:missing value, position:0, 23, class:window, role description:Standardfenster, accessibility description:missing value, focused:false, title:Nuendo 7.1 Project - Untitled1, size:1920, 1053, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXWindow, entire contents:, subrole:AXStandardWindow, selected:missing value, name:Nuendo 7.1 Project - Untitled1, description:Standardfenster, minimum value:missing value, orientation:missing value, position:721, 152, class:window, role description:Standardfenster, accessibility description:missing value, focused:false, title:MixConsole - Untitled1, size:1107, 750, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXWindow, entire contents:, subrole:AXStandardWindow, selected:missing value, name:MixConsole - Untitled1, description:Standardfenster

But how can I now focus the window?

Hey Stevie,

It's hard to write scripts when you don't have the actual software to test with.  :wink:

Try this:

tell application "System Events"
   tell application process "Nuendo"
      set frontmost to true
      delay 0.25
      
      tell (first window whose title is "Video Player")
         perform action "AXRaise"
      end tell
      
   end tell
end tell

If that doesn't work then run this and post the result:

tell application "System Events"
   tell application process "Nuendo"
      set frontmost to true
      delay 0.25
      
      tell (first window whose title is "Video Player")
         actions
      end tell
      
   end tell
end tell

-Chris

1 Like

Hey Chris!

OMG, the first solution already worked, you are my hero, thanks a lot! :grinning:
Now I can finally resize the window the way I want to :blush:

Cheers,

Stevie

Hey Stevie,

Try this:

tell application "System Events"
   tell application process "Nuendo"
      set frontmost to true
      tell (first window whose title is "Video Player")
         perform action "AXRaise"
         set position to {0, 22} -- Top, Left
         set size to {500, 600}
      end tell
   end tell
end tell

Adjust the coordinates for size and position as needed.

-Chris