Is it possible to use the action for Move and Click Mouse from the Top Left Corner of a SPECIFIC window?
I see we can use this relative to the main window, or the full screen, or a found image, but not relative to a specific window.
The reason I'm asking is that I'm trying to use this in an app that has a ton of floating windows with specific names, so the concept of "Main Window" isn't helpful -- the command I'm trying to target is in a non-main window but I can't bring it to the front because it's floating.
Hmmm. In this particular app (Pixelmator) I think it does see the floating window. I wrote an action that said: click on a found image in this window (and I named the name of the floating window) and it works.
However, Pixelmator has several floating windows and none of them have the ability to become frontmost, so I can't use "main window" as a target.
I'm short on time but will check out your tip on Window Information Tools later today. Where do I find info on UI-Scripting? (I'm not familiar with it.)
window "Image Ferrari Enzo ⇢ The open image file.
window "Tools
window "Layers
window "Effects Browser
Invisible Windows:
window 2
window 3
window 5
window 7
window 8
If you can find your window by name you can get it's position, height, and width.
If Keyboard Maestro can see it then you can do this with Keyboard Maestro.
If System Events can see it you can do it with AppleScript.
Named palette windows can be brought to the front by clicking them, but Keyboard Maestro doesn't seem to be able to change the window index.
Here's an example AppleScript you can run from the Applescript Editor:
tell application "System Events"
tell application process "Pixelmator"
set frontmost to true
delay 0.1
tell window "Tools"
return {position, size}
end tell
end tell
end tell
This works to bring the Tools palette to the front:
tell application "System Events"
tell application process "Pixelmator"
set frontmost to true
delay 0.1
tell window "Tools"
perform action "AXRaise"
end tell
end tell
end tell
The Tools palette does NOT contain UI elements that System Events can see, but the Layers and Effects Browser palettes DO contain accessible UI elements.
You also may be able to use the Found Image condition to click where you need if you have a unique image.