How Do I Figure Out What a Given Window's Title Is?

Howdy, I'm just starting with KM and immediately hit a comprehension roadblock. The first macro I'm seeking to understand is How Can I Use Standard Gmail Shortcuts in Apple Mail with Keyboard Maestro? , and it operates using window titles.

My question: how do I determine what a window's title is? I've tried searching all over for 'determine' and 'show' and so on and come up short outside of code samples for stuff like Swift. Some apps (like iTerm2) seem to show their title right on the window itself, but many/most others (like Safari) don't seem to.

You can use Window Tokens as described in the wiki[]=window&s[]=title

1 Like

I'm currently trying to work through , but can't get past "osascript is not allowed assistive access" (in or iTerm2, both of which are explicitly permitted system access). Have also tried putting System Events itself in the access, and have also tried running it in the Script Editor and granting it access to no avail.

I appreciate the pointer and can infer that I can make use of these parameters, particularly %WindowName%. Could you point me in the direction of how I actually use them? I have been using KM for about one frustrating hour, and my best guess was to try to create a global macro which would display a popup with the parameter as its text but I'm not seeing anything like 'show' or 'display' or 'pop' in the action list search.

Well, the link I provided actually shows a KM “Display Text” action. Perhaps there’s a clue in there...? I’m not on my Mac so can’t help very much.

1 Like

Ah, thank you! That did the trick. I must have had a sub-selection while searching. Ended up doing a contortion to copy it to the clipboard then paste out of the clipboard, but Display Text is much better!

Yes - I still get caught out by that sometimes. Try Shift-Cmd-a - pops up a spotlight-style search for actions while editing a macro.

1 Like