Bringing a window to the front

I am using a macro to do some size manipulation of a particular window but can't seem to find it. It is the logcat window of Android studio. I ran a macro I found here to list the windows available and got this output.

studio

window → Logcat

But when I try to use

image

It can't find the window. This is the error I get:

image

Any thoughts or advice?

Hey @hasansidd,

Try out this macro.

List Windows Keyboard Maestro Can See v1.1

If Keyboard Maestro can't see the given window then there are other options.

-Chris

Hey Chris, this is the response I get from that:

image

I actually used another one of your macros that I found googling (I assume you are Christopher stone): Window Discovery Tool → Windows System Events Can See v1.0.

In this macro I can see the logcat window:

image

Hey @hasansidd,

Okay, now we understand the scope of the issue.

Try this.

-Chris


Download ⇢ Bring Logcat to Front.kmmacros (4.4 KB)

Hey @ccstone, thanks for the quick reply and help. I ran this macro and doesn't seem to do anything. I'm kind of new to KM so I don't know if there are some logs or anything that can help tell why it isn't working.

Hey @hasansidd,

Whups. I forgot the Logcat window was part of Android Studio.

Replace the AppleScript in the old macro with this and give it a try:

tell application "System Events"
   tell application process "Android Studio"
      set frontmost to true
      tell window "Logcat"
         if it exists then
            perform action "AXRaise"
         end if
      end tell
   end tell
end tell

-Chris

Awesome thanks so much for the help! Work great. I ended up removing line 3 so it doesn't necessarily open up the Android Studio as well.

1 Like

This might be irrelevant at this point in time but I find I get errors when I used the "with the title" portion of that command. By switching to "with title containing" it works everytime.