How to detect an invisible window?

I have this Java app (CafeTran) that I’m using and I’d like to create a macro to position two windows that are hidden (I mean: that aren’t visible in the foreground).

How should I cycle thru all open windows?

Should I restrict this cycling to the specific app?

Thanks in advance!

Hans

Hey Hans,

You only have two windows open in CafeTran?

You want to resize them the same or differently?

Be more specific.

Absolutely.

Keyboard Maestro should be able to do this by window-index.

Take a look at my List Windows Keyboard Maestro Can See macro to see how to iterate through them.

If all you want to do is resize them the same then something like this AppleScript will work:

tell application "System Events"
   tell application process "CafeTran"
      repeat with theWindow in (get windows)
         tell theWindow
            set {position, size} to {{0, 23}, {960, 1173}}
         end tell
      end repeat
   end tell
end tell

-Chris

Hey Chris,

Thanks for your help!

There is this one big GUI of CafeTran, from which I've made two windows floating. I'd like to displace these at different positions on my secondary monitor. Currently I use this great macro that I've found here:

One window (named 'Matchboard) at position 7 (left third of the screen), one (named Statistics) at position 6 (lower half of the right third of the screen).

The disadvantage of the current approach is that I have to 'fish' for these windows first (via three fingers on the touchpad) and then click on both windows and start the macro to position the windows on the second screen.

My idee was to create one window that would position both windows at their correct places with one keyboard shortcut (lazy as I am).

Hans

Hey Hans,

You mean create one macro?

What's hard about that?

Put your location-specifiers in a Manipulate a Window action similar to this:

That should work.

If not let me know.

-Chris

Thank you, Chris! With 'one macro' I meant: both window positioning commands in one macro. With your valued help I could solve this:

Very happy now!

Hansa

1 Like