Activate Macro only in the Finder (Mac)

I'm not sure how to create a macro to operate ONLY in the Finder. Here's what I have tried (not working)

Thx in advance.

1 Like

PS: For use when I log in as Admin.

  1. At the bottom of the left pane of the Keyboard Maestro Editor, click the plus-sign button (+) to create a new Macro Group.

  2. In the right pane of the KM Editor, name this group however you'd like, then set the Available In All Applications option to be Available In These Applications, then make the Finder the preferred application.

  3. Locate the macro you have already created and drag it from the middle pane of the KM Editor to the appropriate folder-like icon in the left pane (which you created in Step 1).

  4. You can edit your already-made macro to remove the part about This Application: Finder. That part is no longer necessary.

1 Like

Broadly, the key thing to remember is that there are two primary ways to control in which applications a macro can be executed. One is as described above, by making a Macro Group which can only be activated in applications you specify (yes, a Macro Group can be applied to multiple, specific applications).

The other is simply knowing your computer usage. If you know, for example, that you only ever type jip in Finder and Mail, then you may not need to create a Macro Group specific to those applications. Instead, your macro could go in the Global Macro Group (which is built in and works in all applications).

The choice is yours, and my suggestion for these types of situations is to set things up in a way which works best for you. If a Macro Group specific to Finder and Mail will be easier for you to remember should you need to locate the macro for editing, by all means that seems like a better organization.

I did try creating a Group, but missed the drop-down option “in this application”. Now it works where I want it (Finder only) Thanks.

BTW this is a really ‘smart’ user forum (the way it’s laid out, etc.)

1 Like

Actually, problem isn’t yet solved. I’m using this to sign into a window whenever an Admin id is needed, but that’s not the finder in fact. I am not sure what to use to categorize this. Any suggestions appreciated.

What do you mean by “sign into a window”? If you could be more specific, it might help us figure out how to detect the situation.

Sorry I meant user login windows

So are you talking about when your computer first starts, or are you switching users, or what?

Because if you don’t need to do this upon startup, then KM has the “Login Window” and “Fast User Switch” actions. You could use one of those actions to initiate the login, and in the macro that initiates the login, you could pause for a really short delay then put in the password.

Both for user switching and for times when I need to log in as Admin to permit certain actions on the machine (writing to the disk, eg new/updated software or other similar actions needing admin privileges).

By login do you mean “Trigger by…” “…At login”? That doesn’t prevent the JIP keystroke from activating in any window at all (including this one: JIP-Admin).

Not sure I see where I can activate user switching (just to know how_–it isn’t what I need though)

In any event, neither login or user switching are the right prompts; is there one for authentication in general?.

tx

No, what I’m saying you could do is this:

Let’s say you want to login as admin. So you create a macro whose trigger is a hotkey or something.

The first action is “Fast User Switch” that switches to the admin.

Now you know the login window is up, because you made it come up. So the next action is a pause for a half second, or however long it takes for the login window to show up, then the macro should put in the password, and type “Enter” or click the button.

Does that make sense?

Thanks, still not clear. Sorry.

I shouldn’t need to prompt the login window to come up if it is already up. Let’s say I am updating a file that needs admin privileges. The machine opens the log in window. Are you suggesting to re-request that the window appear?

The dialogue window for such cases LOOKS like a user switch window, but it is not the same function

(Found the FUserSwitch action. I don’t want to switch users though!

A further issue (the one I started from): I type “JIP” for lots of reasons. I would have liked the macro to work only in the authorizing environment (triggering the output “JIP-Admin”). Then I can safely go on using “JIP” in other places and not get the same output there. But I suppose I could make life simpler by creating a specific trigger for logging in to a window. Just trying to keep things intuitive and not have to remember so many various triggers. (I have a dozen others.) tx

Ah, now I get it. :slight_smile:

My system isn’t set up in a way that would make this easy to test, I don’t think. So someone else will have to chime in.

I have only followed this thread superficially, but let me take a shot. Are you saying that you want your password filled in automatically whenever the system pops up a dialog asking for authorization? (For something like installing new software, deleting something from /Applications, etc.). I am suggesting this because it’s something that bothers me. In fact, I got so tired of typing my password that I changed it to a single character.

The only thing I think you could do to handle this kind of dialog, and I don’t think it’s worth the bother, would be to put in a macro that starts on login and loops with a delay and using a Found Image condition then Click at Found Image if it finds it.

(To get the image you would use ⇧⌘4 to take a screenshot, press space, hold down ⌃, and click on the dialogue. Or, you could forget the space and just drag out an area that covers part of the dialog. Then, paste it into the image box of the condition and action.)

Seems pretty heavy-handed to have this loop running all the time. Not that it would use resources, but just as a matter of aesthetics and complexity. There’s no trigger that can handle a dialog opening, presumably because there is no system event that broadcasts a notification when a dialog opens, so there’s no way for KM to know about it.

Not password (that might be a security hazard), but only the user name for the admin account.

Right now I’ve given up using the initials “JIP” to trigger this event and am using control-J instead. That seems to work (allows me to use “JIP” elsewhere without it coming out as “JIP-Admin”).

Didn’t mean to create a ruckus! Just thought that KM might help me isolate a setting (context) in which I wanted this particular event to occur. Seems like it can’t for this situation. tx very much.

No ruckus! We’re having fun trying to figure this out. Well, now I’m having fun watching, but still… :smile:

Don’t worry — the site might as well be named the “Keyboard Maestro Ruckus Playground”.

2 Likes

:wink:

For a situation like this, rather than type jip, which may need to be used elsewhere, I make a globally usable macro invoked with a text trigger that won’t be at risk of being invoked when not wanted. In this case, I would simply make the text trigger something like jjj.

How about:
.jip
(period-J-I-P)
or ..jip (two periods)

or jip.. (two trailing periods)
Keeping in mind that if you do a lot of pauses with periods...

...You'll end up triggering it.

Or maybe like a switch --jip

Or maybe a less likely combo... "pij" ( the reverse) PIJ is probably less likely to show up in your usual typefest.