A Few Questions Before Digging In

I have created most of my automations using AppleScript and Moom and recently a few people pointed me towards Keyboard Maestro.

I would appreciate answer to the following before I dig in and invest the time moving to Keyboard Maestro.

  1. Can KM be used to open applications including applications with credentials specific examples of which include 1Password, Excel files that are password protected, Quicken file that is password protected, Word files that are password protected, etc.)? Will KM do all of these?

  2. Can KM be used to open Safari webpages including entering the log in credentials?

  3. Can KM be used to reposition windows including minimizing windows; for example, can I create a macro that positions a window and then minimizes all other windows (ie. is this possible)?

  4. Does KM allow macros of macros. For example, can I create seven macros to open seven apps and then create a macro of the seven macros so that I could use one key stroke to open all seven apps when I start my MacBook?

  5. Finally, where on this site would you point me to get tips and tricks for setting up KM properly the first time.

Thank you.

Keyboard Maestro can do all those things and more, though not without a learning curve. To specifically answer your last question, as it seems the most salient for when you're just starting out, here are some beginner-specific tips:

  • Read the KM Quick Start
  • Do the tutorial (Help ➤ Tutorial) in the KM Editor.
    • Gives you a live walkthrough of creating a macro
  • Try installing and using the sample macros in the Macro Library
  • Review/Browse the Available Macro Actions
  • For help with an action in your macro, click on the gear icon image at the top right of the action and select "Help"
  • Make good use of the KM Wiki
  • Start small, and grow your macros organically
  • Be prepared for some trial and error in the beginning
  • Make good use of this forum
    • Search for existing macros
    • Post your questions/issues if you get stuck
  • If you want to really get your feet wet and have someone walk you through the basics to the complex, consider looking into David Sparks' Keyboard Maestro Field Guide

Good luck, and feel free to post again if you have more questions.

2 Likes

@gglick, thank you for your helpful answer.

I have started playing with KM and it is amazing. I wonder how I did not hear about it before and live without, it is amazing.

One question for you. Would you please show me how to make a macro that minimizes all windows EXCEPT the front window as cannot see how to do this.

Thanks!

2 Likes

You're welcome, and sure thing. There's more than one way to go about this, of course, but one relatively simple way, if perhaps non-intuitive, is to use a regex that minimizes all the windows with titles that don't match the front one:

Minimize All Windows Except Front.kmmacros (1.8 KB)

2 Likes

@gglick , again, thank you much appreciated, but unfortunately that did NOT work (i.e. nothing happens when I execute the macro). I need how to learn the language to do that.

And, because as a newbie I am thread limited, I will post here….

I am loving KM and very impressed after only an hour of playing.

I do need help with 4 things that have baffled please:

  1. How do I create a macro for an app that needs a password to open; for example 1Password.

  2. How do I create a macro to open an Excel password protected file.

  3. I noticed that Spotlight does not respond to window move commands, is this normal? To add to this, I created a macro to centre windows and the Spotlight bar does not centre / move when enabling the macro.

  4. Where / how is the best place to learn the language / syntax to specify file name with wildcards, etc.

Thanks!

Most of us share you admiration for KM. I'll leave your first question to the person who provided the solution to you, but I may have other helpful answers for your other questions.

There are different answers depending upon your current skill level. The KM Help menu contains a menu item that takes you to a reference website, but reference websites aren't always the best place to learn. Perhaps if you are familiar with some other wildcard syntaxes, then maybe you will learn best with "https://regex101.com" which lets you poke around with live windows to enter your syntax and your data.

I have no trouble moving the Spotlight window around. I googled your problem and found this: " To be able to move Spotlight around you'll need macOS or OS X 10.11 or later on the Mac"

I don't have Excel, but if you document how you do it with the keyboard and mouse, I can tell you how to encode those actions in KM. Or if you search this website, you might find the answer. I found relevant posts when I searched this website for "excel password protected".

I don't have 1Password. but I see there are threads on this website about that, so you can search this website for that topic.

P.S. I'm just guessing, but it could be that the reason gglick's macro didn't work for you might be because you didn't trigger it the right way. How exactly did you trigger it?

@Sleepy , as a start thank you for responding and please explain to me how the quote function works on this website!

As to the issues / problems here goes:

  1. SPOTLIGHT: I am running os 10.15 so should be good but the window move to centre command is not working. Would love to get this figured out and working.

  2. GGLICK Macro: It does not work because it minimizes the frontmost window. I want to MINIMIZE ALL WINDOWS OTHER THAN the frontmost window! It is "backwards"!

  3. I have a bunch of other problems but will leave them until I can post separate threads to make life easier.

Thanks!

Ohh. When you said that, I thought you meant moving the window manually with the mouse, because KM doesn't have any "commands" it has "actions." I guess we'll check that up to misunderstanding. Let me reconsider that, then.

As for GG's macro, I'll let him troubleshoot that with you.

If you say Spotlight isn't responding to the move window command, I will believe you. Although I don't know how to fix that, or if it's fixable, there is a workaround. You can probably do this workaround in a single statement. Basically you use the Click and Move Mouse KM action to click on the Spotlight magnifying glass on the screen, and drag it to the new location.

Would you be happy with this workaround, or would you only be happy with getting the Move Window action working?

This will move Spotlight to the centre of the screen, not accounting for its width.

image

@Sleepy , I appreciate the response and will it a go.

I will admit that while I remain enthusiastic I have run into a number of problems with KM that I do to know how to solve without using AppelScript which defeats the purpose. This is particularly true given most of the AppleScripts I tried work as standalone AppelScripts but do NOT within KM.

With a little luck others will be able to help me.

Thanks.

Sure thing. My knowledge of AppleScript is limited. I'm not sure if I agree or disagree with your idea that "if it requires AppleScript, that defeats the purpose." You could also say the same thing with shell scripts, like, "if it requires a Shell Script, then that defeats the purpose." But I don't think it's the job of KM to duplicate all shell commands. KM does duplicate a handful of shell commands, but it's not a 100% perfect duplication.

I'm surprised that you asserted that "most of the AppleScripts you tried work as standalone AppleScripts but not within KM." I didn't know that was even possible, let alone common. Obviously you know more than I do about AppleScripts.

Hi @Joel - you’ve been asking for examples of how to do stuff with KM so now I’ll ask you to provide examples of those AppleScripts you say don’t work in KM so we can see what you’re trying out, especially given that you’re new to KM. Of particular interest is how you’ve embedded those AppleScripts in KM.

@Sleepy with KM goes simply everything :wink:

2021_12_12_Support_1

I have contacted @Joel via a DM and will explain how to create the KM macro.

It could be that an important setting/requirement for the execution of the AppleScripts in KM is missing :thinking:

1 Like

Hey Joel,

That's because @gglick tried to use a range with negation to try and negate a literal string, and it doesn't work that way in regex.

I've made that mistake myself, once or twice...

This does work – and I’m even escaping any possible regex metacharacters in the window title.

Minimize All Windows Except The Front One v1.00.kmmacros (5.3 KB)
Keyboard Maestro Export

The regular expression here is complex using negative-lookahead and beyond most normal users, but you can quite easily:

  • Get the window count (not obvious how).
  • Loop through and minimize by window index.
  • Ignore window 1.

Note – I personally would not give up Moom for Keyboard Maestro. I like Moom and use it along side KM for what it's good at.

-Chris

2 Likes

@Sleepy, many thanks for your continued assistance. As a newcomer to this forum I am restricted to one post in teh first 24 hours. I will be posting a separate thread on the problems that I have encountered with AppleScript hopefully this will help.

I do hope to get KM sorted out as it looks very powerful for now I am stuck all over the place.

Thank you.

@tiffle, many thanks for taking the time to respond, it is greatly appreciated!

As noted in my immediate preceding post, as newcomer to this forum I am restricted to one post in teh first 24 hours. I will be posting a separate thread on the problems that I have encountered inclusive of the macros as soon as I am allowed. They are all teed up and ready to go.

Thank you.

1 Like

@ccstone : Christopher, I thank you for the macro but it did not work for me. When I tried to run it I got the following notification:

Screen Shot 2021-12-12 at 9.20.08 AM

And yes, I did have a number of windows opened.

Would greatly appreciate any assiatnce you can provide in getting this going.

Chris, that is my thinking for now!

Ahhhh, dumb question! Is there a way to print a macro so that I can look at while creating other macros and use it as a guide to make sure things are consistent and properly done?

@Joel in the following example the window in the foreground (here Drafts App) is moved to the center and all other open windows are hide.

2021_12_12_Support_1

Windows Hide others <0D61 211212T155855>.kmmacros (2,5 KB)

Windows Hide others <0D61 211212T155855>

In the first action in the macro you can adjust the individual window positions under "Center".

Not sure if this will help but you can have more than one KM editor window open at any time - just use File>New Editor Window from the KM menu, or shortcut N