Differentiate between multiple windows of same app

Hi, I'm trying to differentiate between multiple windows of the Ableton Live app so that I can use "move to" and "resize to" actions to quickly position them in a specific way on my screen. Could you please help?

There are 3 windows- the main window (that is called Untitled by default, but changes name if i save the project), a second window which closely resembles the first (but has less features and never has a title), and a third window which is small and always titled [mixer]. The issue that i'm running into is that not all of the windows have specific names or anything that i can figure that reliably differentiates them. I''ve tried using the 'window with window index' parameter, and this works very well when i only use 2 windows, but when i add the third window into the equation (the small window mixer), it breaks down and starts resizing/moving the wrong Ableton windows. I've tried several combinations of different index window numbers, but haven't been able to get it to consistently work correctly.

Pictures of the macro and the windows below. How can i make this macro function properly so that it correctly differentiates and resizes/moves the right windows?

Hey @danklim,

Front Window Analysis Tool for System Events

In succession with each of your 3 windows:

A) Make the window the frontmost window.
B) Run the Front Window Analysis Tool.
C) Post the results for each window, so I can see the attributes.

-Chris

Thanks! Not sure if something messed up here...

The main window (that usually says untitled):

/var/folders/0b/0kj801cd135bk42qqs57v_440000gn/T/Keyboard-Maestro-Script-428723B3-6343-4BF5-9B3A-14ADC7B43241 157 167 execution error System Events got an error Can’t get application process "BBEdit". (-1728)


Second window (that never has any title):

/var/folders/0b/0kj801cd135bk42qqs57v_440000gn/T/Keyboard-Maestro-Script-FB5591DC-0981-49D0-ACB5-D93B1A6BEA84 157 167 execution error System Events got an error Can’t get application process "BBEdit". (-1728)


Small mixer window:

/var/folders/0b/0kj801cd135bk42qqs57v_440000gn/T/Keyboard-Maestro-Script-191942CA-EA7C-4202-801F-62D733C0EBD5 157 167 execution error System Events got an error Can’t get application process "BBEdit". (-1728)

Ok realized i needed to download the BBedit app, here are the results:


The main window (that usually says untitled):
minimum value missing value
orientation missing value
position 108, 75
class window
accessibility description missing value
role description standard window
focused true
title untitled text
size 1008, 1077
help missing value
entire contents
enabled missing value
maximum value missing value
role AXWindow
value missing value
subrole AXStandardWindow
selected missing value
name untitled text
description standard window


Second window (that never has any title):

minimum value missing value
orientation missing value
position 108, 75
class window
accessibility description missing value
role description standard window
focused true
title untitled text
size 1008, 1077
help missing value
entire contents
enabled missing value
maximum value missing value
role AXWindow
value missing value
subrole AXStandardWindow
selected missing value
name untitled text
description standard window


Small mixer window:

minimum value missing value
orientation missing value
position 108, 75
class window
accessibility description missing value
role description standard window
focused true
title untitled text
size 1008, 1077
help missing value
entire contents
enabled missing value
maximum value missing value
role AXWindow
value missing value
subrole AXStandardWindow
selected missing value
name untitled text
description standard window

Hey Chris, have you had the chance to check the attributes yet? Would really appreciate your advice! :slight_smile:

Hey @danklim,

The window properties you posted are all identical (other than your edits).

This means either one of your windows is floating on top of the others, or you didn't select the correct window to make it frontmost before running the macro.

Try again, and if you need to (and are able) dismiss all windows but the one you're trying collect information on.

If we have to we'll take a different tack, but hopefully you'll get good data this time around.

-Chris

Hey @danklim,

Run this macro to get the properties of every window open in the frontmost application.

-Chris


Front Application --> List all windows with their properties.kmmacros (12 KB)

Thank you!

Just ran the new macro you provided. I was very careful in selecting the correct windows last time, assuming that it's not necessary to try the single window macro again since this new macro seems to have the same effect, but please let me know if i should.

Also, not sure why it shows a 4th window here... when i hit cmd+` to cycle through windows, there are only 3 windows in the cycle and i only see three.


Window 01 -->

-286
accessibility description : missing value
class : window
description : window
enabled : missing value
focused : false
help : missing value
maximum value : missing value
minimum value : missing value
name : missing value
orientation : missing value
position : -1724
role : AXWindow
role description : window
selected : missing value
size : 156, 193
subrole : AXUnknown
title :
value : missing value


Window 02 --> Untitled

-1182
accessibility description : missing value
class : window
description : standard window
enabled : missing value
focused : true
help : missing value
maximum value : missing value
minimum value : missing value
name : Untitled
orientation : missing value
position : -2058
role : AXWindow
role description : standard window
selected : missing value
size : 1803, 1139
subrole : AXStandardWindow
title : Untitled
value : missing value


Window 03 --> [mixer]

-274
accessibility description : missing value
class : window
description : standard window
enabled : missing value
focused : false
help : missing value
maximum value : missing value
minimum value : missing value
name : [mixer]
orientation : missing value
position : -1815
role : AXWindow
role description : standard window
selected : missing value
size : 1261, 322
subrole : AXStandardWindow
title : [mixer]
value : missing value


Window 04 -->

-1298
accessibility description : missing value
class : window
description : standard window
enabled : missing value
focused : false
help : missing value
maximum value : missing value
minimum value : missing value
name : missing value
orientation : missing value
position : -2038
role : AXWindow
role description : standard window
selected : missing value
size : 1705, 1000
subrole : AXStandardWindow
title :
value : missing value


Hey @danklim,

Okay, that probably means there's an invisible window that's on top of everything (window index 1).

Unfortunately the new info doesn't give us much to work with.

-Chris