Bring One Application Window with a Specific Title to the Front?

Peter does this work on the actions or does "insert" in the Macro Library window insert the folder and the items contained within? I did the same thing Mike did last year when I got Keyboard Maestro. I see some that might be nice to have back.

The biggest issue about Mac apps, compared to Windows, has to do with UI conventions. I’m not worried about the Finder or System Preferences.

I have struggled with several Mac apps now, with UIs that make no sense to me. However, I have learned something about Mac UI conventions. Mac apps often have a window divided into several areas, like “view ports” let’s call them. The left most viewport, or perhaps two or three columns, are devoted to selecting things. The right viewport shows you what you’ve selected.

Another theme is that the left viewport has a list of items which you drag toward the right.

You may notice that Keyboard Maestro does both things.

Another Mac app I’ve using, called MidiPipe, has a right viewport, and you select what appears in it via a drop-down menu above it. The left viewport is a list of things that you drag to the right, and itself has a drop-down menu that can be used to filter the type of items that appear in it.

This looks strange and non-intuitive to my eyes. By the way, I’ve used iTunes on Windows for years, as well as an iPod. I love Apple-developed apps. The apps I’m talking about now are non-Apple developed.

Here is what looks weird. I’m not getting visual or functional cues that tell me the relationship between view ports. Consider MidiPipe. Consider the right viewport. It has a drop-down selector that chooses what goes into it. Well, in a MS Windows app, there would probably be a title to the viewport with a name and a colon, like

“Pipe 1:”

Or maybe

“Components of [Pipe 1]:”

That gives me the cue that the viewport contains the components of “Pipe 1.” In MidiPipe, however, I can’t see anything connecting the drop down list and the contents of the viewport.

Also, when you select a new item from the drop down list, the contents of the viewport just change instantly to the new context. I understand how that looks in iTunes, but in both MidiPipe and Keyboard Maestro I feel confused, like “where did my contents go?”

In Windows this would be handled in several possible ways. One way would be that selecting a “pipe” (or macro in KM) brings up a dialog. This gives you the cue “I just selected something, I am now looking at it.” It might be a window, subwindow, or floating dock in addition to a dialog. There would then be a specific mechanism for dismissing the dialog, so you would have confidence about what happened to that information.

Another way to handle it would be a tabbed dialog. If there are several things that can be selected, each would have its own tab. Selecting a tab shifts the context, but you can see what happened to the old information… the other tab would still be there, and you can see visually that its contents have been temporarily covered.

I’ve noticed that the Mac system preferences dialog has situations that would be a tabbed dialog in Windows, but instead there are several side-by-side buttons with no other visual connection. However, there seem to be other cues that tell me what’s happening.

In general I think Apple makes great UIs.

You could say that my “complaints” about lack of visual cues or confirmation of actions is just a newbie complaining about something unimportant, but I think that these issues are the “ergonomics” of a UI. Getting them right is what makes a UI pleasant to use.

I knew some geniuses where I used to work as a programmer who seemed to be totally insensitive to the “feel” of their software, either how it was used or how it was organized in code. As far as I could tell, they had so much spare brainpower that they could use one part of their brains to think creatively about the task at hand, and another part to recall any arcane or non-intuitive facts about the system they were using at the very same time, and it felt perfectly natural to them.

However, I can’t do that. If I want to focus my brain on the creative aspect of the job at hand, then I need the UI to function in tune with my thoughts and intentions, or else I feel like I’m fighting it.

And I think Apple in general does a better job of that. Bill Gates is an example of someone so smart that he never needed a computer to be intuitive.

KM seems pretty good now that I’ve figured out the basic filter/viewport/drag thing.

However, there is one Mac app that I think is objectively a bad UI. It’s a media player called JRiver, and it’s absurdly complicated and non-intuitive. I think what is objectively bad about it is how inconsistent it is and how it doesn’t follow even its own logic.

Apple created a very complicated media player in the form of iTunes and made it smooth to use. Quite an accomplishment.

Insert will insert the selected entry from the Macro Library, which may be one or more macros.

All of the default ones are in there, as well as a variety of other ones.

I believe they're generally called "Splitter Groups" and/or "Scroll Areas". They follow the basic convention that "Finder" uses, when set to "Columns View". I'm going out on a limb here, but I think this was an older UI convention on the Mac, and I don't see it as much anymore. Could be wrong there, though.


But let's step back for a second and talk about KM itself. I agree that the interface is not intuitive. Even as a developer, I initially found it, I don't know if this is the right word, but intimidating. I just couldn't wrap my brain around it at first. It's just a completely different beast, to me.

And this is actually one of the reasons I've written so many macros for use within Keyboard Maestro. To help get the UI to work more like I want it to.

So, it took me awhile to get used to it.


OK, with all that said, here's the most important point: Keyboard Maestro is the most deep and thoroughly fascinating tool I've ever used, aside from conventional programming environments, and maybe even them. I've been able to do things I would never have dreamed of.

And the more I learn about KM, the more convinced I am that Peter is a true genius. I don't say that lightly - I've been a professional developer since before the original PC came out. Trust me on this - get past the UI and start doing things in KM, and after a while, you won't give a shi hoot how the UI works. Or at least, you'll take its quirks as you would a loved one's, and learn to either embrace them or at the very least, tolerate them because of the joy you get from the package as a whole.

I guess the better question I should have asked was: "Can I select a folder on the left column and insert that, and if I do will all the other sub entries inside it also transfer back into the users UI, in other words can I select all the folders and restore them all to the left if I had deleted them?"

I did test this and it appears that the folders are not added only the sub items (macros) on the right column.

Mike we all have I suppose. There are a ton of reasons for that I think. Some suggested thoughts on this...

Windows software seemed to be built and focused on a user doing data entry AND using a keyboard. Hence the reason why I first favored the Palm Desktop Software on Windows. I hated the Mac Palm Desktop Software. I had a lot of stuff to put in and I could go from field to field and it was alway obvious what shortcut keys I needed to use to select a radio button or pop up menu.

I think the two operating system UIs were coming from totally different desires/requirements of a UI. Steve Jobs wanted the end user to "point and click". He wanted to make it easier for someone who didn't know how to use a computer to sit down and figure out how to do something on a Mac. Bill Gates original goal was to "bring a windowed environment to DOS that looked like a Mac". That's my take.

Now the thing that's driving UI Interface design is "How do I put this on a tablet so any user can use it?" There's also gestures to consider; shake, right/left swipes, portrait or landscape device orientation. Another thing I think that drives at least Mac development is programming tools. After poking around with Swift a bit I can see why consistency across different developers apps looks generally the same.

Macs come from a point and click philosophy so I think that's why we sometimes get frustrated. We just want to hit letters, tab, and return. :wink:

2 Likes

No, you can only insert one macro library entry at a time.

In the Mac world, where possible, you avoid an installer unless necessary. And generally it is only necessary if the application wants to mess with your system, which makes an installer something of a warning sign for users.

Indeed, Keyboard Maestro does not “install” anything. Once you quit Keyboard Maestro and the Keyboard Maestro Engine your system is entirely unaffected by its presence.

Also on the Mac, generally for non-document oriented applications, information is stored in various folders in the ~/Library folder, which in turn is hidden from the user (in the Finder, hold the option key down and select Library from the Go menu). I am ambivalent about the decision by Apple to hide the folder, but it is certainly true that for most users, mucking around in the Library folder is a good way to mess up your system.

As described in the documentation, Keyboard Maestro stores its information in:

  • ~/Library/Application Support/Keyboard Maestro folder - your macros, variables, clipboards, and pretty much all your data is stored here.
  • ~/Library/Logs/Keyboard Maestro folder - just logs for the editor and engine are here.
  • ~/Library/Preferences/com.stairways.keyboardmaestro.* 3 files - general preferences, window settings, and such.

plus the Keyboard Maestro.app application, which can be placed anywhere, but should normally be placed in either /Applications or ~/Applications - and with Sierra it is important that you move it somewhere out of the Downloads folder because yet another bizarro Apple security feature will otherwise make automatic updates fail.

There are tools which will delete an application and all its settings, but frankly I would not recommend them.

It still seems pretty heavily used:

  • Finder in column view
  • Mail
  • Preview
  • Automator

BTW, the reason that the action selector covers the first two columns of the window is simply a requirement of screen space - if you all had iMacs, the action selector would be a drawer on the right side of the window, but that simply would not work on MacBook sized screens.

It’s probably not useful to discuss Keyboard Maestro UI in a topic on bringing windows to the front. If folks which to discuss it, especially if there is actually something constructive to say rather than just "I don't like it" or that it is not intuitive (which is fine to say, but does not lead to an improvement), then a new topic would be more appropriate.

1 Like

A late hello. I realize this is an older topic/ post, however there is no mention of what version JMichaelTX’s answer relates to- guessing 7.x.

I am a brand new user and am ‘stuck’ at version 6.4.8 due to my (Mac) OS version 10.9.5. I am not seeing “Bring Front Window to front”. Am guessing it is a version issue. This is the very first macro I am trying to build and am not finding a way to do it. Is there a different action in 6.x?

It also looks like from that same screenshot that there are many more Actions available. Is that true? Or is what I am seeing user created?

I am hoping that KM can replicate all of my macros so I can (seamlessly) replace our current keyboard shortcut app across the office.

Thanks in advance.

Bring to Front is a variant of the Manipulate Window action.

So add the Resize a Window or any of those window actions, and then look at the popup menu for the action. I cannot remember if Keyboard Maestro 6 had Bring to Front in it, but I'd be surprised if it didn't. Yes, according to the version 6 documentation, it does have Bring to Front as an option.

Even in Keyboard Maestro 6, there were many actions, and many actions also have many variants.

Keyboard Maestro can do pretty much whatever any other macro app can do with very few exceptions.

Thank Peternlewis. Will dig around some more. I would be surprised if it wasn’t there from what I’ve read about KM.

The bulk of this Post seems to be more about getting KM to work. Maybe those parts are better located elsewhere?

Anyway, back to the original question (tho maybe this is another case of KM misbehaving and the rest of the posting ARE need here...) of bringing a particular app's window to the front:

I have this action (which I also tried the "windows with title containing" option):

For this window in TextEdit:

I'm using in this Macro:

I'm activating by clicking on "Close Cheat Sheet" in this palette in Safari:
13%20AM
Which switches to TextEdit then stops without bringing the window forward.

I've also tried a conditional pause but keep getting a false for the condition being met so it seems KM is having an issue seeing that window.

When I click on the gear on the Bring Window(s) With Name Matching action and select Help I'm taken to the Wiki here:
https://wiki.keyboardmaestro.com/action/Manipulate_a_Window?redirect=1

where I can't find something to resolve this. Help please.

I have restarted KM Engine, restarted KM, and shutdown the iMac all to no avail.

Ultimately I looking to be able to open and close a pic from a palette. The open part works.

Thanks!

Hey Bern,

Somehow I doubt your window title matches what you use in the macro.

Try switching to contains.

If that works then find out what the actual window title is.

-Chris

If you just want to close this window, there's no need to activate the app, bring the window to the front, or type a keystroke. All you need is a single Manipulate a Window action:

Close Cheat Sheet.kmmacros (1.8 KB)
image

I created a TextEdit document with the same name to test this, and can confirm it works fine with the "containing" condition rather than "matching".

Hey @gglick @ccstone

In my stumbling around I misled you. That doc is a screenshot from @JMichaelTX Forum Cheat Sheet (How to Use This Forum) topic that opens in Preview not TextEdit. Changing the target app resolved it using any of the three title parameters.

Seeing that I can close a doc without all the other actions made my clumsiness seem almost purposeful. Making your partner look good even when he's off is a mark of being skillful, adult, generous, and kind.

image
Thank you both for allowing me to borrow your light to find my way!

2 Likes

Conversely, is there a way to switch to a window whose title does not contain certain text?

Use case: I need to select the currently open plugin window in Logic before running a macro. The plugin window title changes depending on the track it's on, but the other window titles always include " - Tracks" or " - Mixer".

Hey Neil,

You can do that with AppleScript:

--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2021/07/15 19:51
# dMod: 2021/07/15 19:51 
# Appl: Finder, System Events
# Task: Bring the Window Whose Name Does NOT Contain “Mixer” Or “Tracks” to the Front.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Finder, @System_Events, @Window, @Front
--------------------------------------------------------

tell application "System Events"
   tell application process "Logic Pro"
      set winList to windows whose name does not contain "mixer" and name does not contain "tracks"
      if length of winList = 1 then
         set winRef to item 1 of winList
         tell winRef
            perform action "AXRaise"
         end tell
      end if
   end tell
end tell

--------------------------------------------------------

It's possible with a Keyboard Maestro native action too, but you need a sophisticated understanding of how to use a negative-lookahead regular expression.

Bring Window Whose Name Does NOT Contain “Mixer” or “Tracks” to Front v1.00.kmmacros (5.7 KB)

On the other hand you could brute force it by getting a list of all the windows Keyboard Maestro can see in the given app, parse the list, and choose the window title NOT containing the undesired strings.

(This method would be more available to the average user.)

List Windows Keyboard Maestro Can See v1.1

-Chris

2 Likes

You, sir, are awesome! The AppleScript one works perfectly! Thankyou! :slight_smile:

1 Like

Here's slight adjustment to your regex-based idea. There seems to be an issue with KM 'seeing' Logic Pro plugin windows at the moment, but I've tested with other apps and it does work.

Non-Matching Window To Front.kmmacros (22 KB)

Macro screenshot