Thanks for clarifying that. It's perplexed me for some time!
Another thing I've just noticed.
If I use KM to list all windows in Logic Pro, everything looks okay.
This will bring the Tracks
window to the front:
However, this will not bring the plugin window whose title is Guitar
to the front:
Hmm... That's weird.
If KM can see the window it ought to be able to operate on it.
- Make sure you don't have any invisible characters in the window title.
Where are you getting that window list?
If that's my tool for System Events then that's most likely the problem – that tool specifically reveals windows System Events can see – not windows KM can see.
Wouldn't matter if I did, as I'm using the "containing" option. Also, I've tried on multiple plugin windows on different tracks.
Well, it isn't "the problem"; it's a great tool! The problem is that, all of a sudden, Logic plugin windows hate me.
Sounds like it isn't the detection/targeting that's the problem, but the "promotion" of the window to frontmost. Is the window listed in the "Windows" menu? Could you perhaps use something like
to get round the problem (having the menu flash up isn't as smooth, but better than nothing...)?
Actually ‘doing the thing’ isn’t really the issue. Simulating the cycle windows hotkey until %FrontWindowName%
matches works fine. It's more that I'm perplexed as to why Logic's plugin windows would stop playing ball all of a sudden.
After all these years, I'd have thought you'd be more perplexed if Logic behaved consistently month to month!
Not exactly...
What if your window name is “Guitar”, but your Action text is “Guitar ” with a space?
See what I mean?
When you test for things like the FrontWindowName token it's a good idea to use quotes of some kind around the token, so you can see any oddball spaces:
Front Window Title.kmmacros (3.3 KB)
I'm using guillemets, because they're not likely going to be in any text I test – but you could use quotes or bullets or whatever you like.
Keep in mind too that the Display-Text-in-a-Window action TRIMS text, and the quotes prevent that from happening.
I can't tell you how much hair I pulled out, before I discovered that little issue.
It's also a good idea to copy the text result and paste into BBEdit or another text editor that can show invisible characters.
Change this script to appropriately reflect your app and window name and run it from Script Debugger:
tell application "System Events"
tell application process "BBEdit"
set frontmost to true
tell window "untitled worksheet 74"
perform action "AXRaise"
end tell
end tell
end tell
Let me know if it brings the window to the front or not.
I think I took the question too literally. But no, no spaces on either the title itself or in the action:
The fact that front window actions (found image etc) no longer work either tells me there's a problem beyond user error.
Really? Interesting. Under what circumstances? I've checked for trailing whitespace in the past and it's always been there.
It does indeed and is similar to the method I was using to bring a window whose name doesn't match to the front. However, it's noticeably slower than cycling windows.
As I said before, I can already "do the thing" but what I don't understand is what might be causing these windows to become opaque to KM. I get that Chromium might have these issues, but this is an Apple app for gawd's sake.
OK this is frustrating.
Can't get %FrontWindowName% or use any in the front window functions for UA Console either.
Can anyone else confirm this behaviour? Maybe it's a Ventura thing? To be clear, these functions work for most apps, but not for Brave, Console or Logic.
macOS 13.2
Logic Pro 10.7.7
UA Console 10.2.2
Add another dimension...
Display Text Dialog Trims Vertical Whitespace- v1.00.kmmacros (7.0 KB)
Macro Image
Have a look at this:
Please report the details about the windows you're not able to work with.
Thanks Chris!
Okay here's what I get:
An app that works fine, as a reference:
Keyboard Maestro
--------------------------------------------------------------------------------
Window Name : Keyboard Maestro Editor — Report Window Properties v2.00
Application : Keyboard Maestro
--------------------------------------------------------------------------------
minimum value : missing value
orientation : missing value
position : {368, 1164}
class : window
accessibility description : missing value
role description : standard window
focused : false
custom title : Keyboard Maestro Editor — Report Window Properties v2.00
size : {1210, 941}
help : missing value
entire contents : {}
enabled : missing value
maximum value : missing value
role : AXWindow
value : missing value
subrole : AXStandardWindow
selected : missing value
name : Keyboard Maestro Editor — Report Window Properties v2.00
description : standard window
--------------------------------------------------------------------------------
Three apps with issues:
Brave Browser
--------------------------------------------------------------------------------
Window Name : Report Properties of the Front Window - Macro Library - Keyboard Maestro Discourse - Brave
Application : Brave Browser
--------------------------------------------------------------------------------
minimum value : missing value
orientation : missing value
position : {417, 111}
class : window
accessibility description : missing value
role description : standard window
focused : false
custom title : Report Properties of the Front Window - Macro Library - Keyboard Maestro Discourse - Brave
size : {1118, 833}
help : missing value
entire contents : {}
enabled : missing value
maximum value : missing value
role : AXWindow
value : missing value
subrole : AXStandardWindow
selected : missing value
name : Report Properties of the Front Window - Macro Library - Keyboard Maestro Discourse - Brave
description : standard window
--------------------------------------------------------------------------------
Logic Pro Plugin UI
--------------------------------------------------------------------------------
Window Name : Guitar
Application : Logic Pro X
--------------------------------------------------------------------------------
minimum value : missing value
orientation : missing value
position : {596, 270}
class : window
accessibility description : missing value
role description : dialog
focused : true
custom title : Guitar
size : {904, 667}
help : missing value
entire contents : {}
enabled : missing value
maximum value : missing value
role : AXWindow
value : missing value
subrole : AXDialog
selected : missing value
name : Guitar
description : dialog
--------------------------------------------------------------------------------
UA Console: Nothing happens when the macro runs; no PWL appears.
Brave is not about the windows – it's about how they've frelled-up the Scripting UI – probably.
I've given up on them (unfortunately), because they broke something utterly vital to my workflows (WhereFrom metadata in downloaded files).
The Logic window shows as a Dialog – Keyboard Maestro doesn't see those as windows.
As for UA Console...
Run this in Script Debugger and see if get a result – if so make sure you get the name right for the next script.
set appNameContains to "ua"
set AppleScript's text item delimiters to linefeed
tell application "System Events"
set nList to name of processes whose name contains appNameContains
if nList ≠ {} then
return nList as text
else
return "Not Found"
end if
end tell
If System Events sees UA Console then run this one, and find out if SEV sees UAC's windows.
tell application "System Events"
tell application process "UA Console"
properties of windows
end tell
end tell
So despite KM being able to get %FrontWindowFrame%
and %FrontWindowName%
, it can't use that info to act upon a Dialog in the same way as it can a Window?
This reminded me that the app name ("Console") differs from the process name "UA Mixer Engine". Good catch!
Bingo!
UA Mixer Engine
minimum value:missing value
orientation:missing value
position:0
25
class:window
accessibility description:missing value
role description:standard window
focused:true
title:Console: Default*
size:868
1055
help:missing value
entire contents:
enabled:missing value
maximum value:missing value
role:AXWindow
value:missing value
subrole:AXStandardWindow
selected:missing value
name:Console: Default*
description:standard window
You're saying KM can get those values for the Logic dialog window?
That surprises me, as KM normally cannot see system dialogs (as windows) at all.
Yes, exactly. I can get the window frame and title, but I can't use them in KM actions without workarounds.
Find image within bounds of plugin UI window:
Bring plugin UI window with title to front:
What a pain...
Bad Apple!