Automating switching to the Login Window to change accounts?

I do a lot of fast-user switching. Because I have a TouchID keyboard, once I get to the Login Window, I can choose which user to switch to by pressing the finger whose fingerprint is associated with the switch-to user.

What I need is a macro that I can trigger with a keystroke to go to the Login Window.

However, when I use the "Login Window" action, it doesn't take me to the Login Window. Instead, it drops down, from the user-name status item in the menu bar, a panel with (a) an avatar for each possible user, (b) a "Login Window…" item, and (c) a "Users & Groups Preferences…" item. (See pasted graphic.)


So I need to find a second action that will click on the "Login Window…" area of that dropdown.

Is there a way I can directly target the text "Login Window…"?

If not, I guess I can try to use a "found image" approach, but I'd limit the image to just the two lines of text (so that it would be robust to the addition/subtraction of users).

In fact, I have a version of this approach that works (as long as I use "Try" in the Editor, but not (puzzlingly) when I use it outside the Editor).

But, since it's based on the image, and that image looks different in Dark Mode and Light Mode, this macro doesn't work except in the mode in which the screen shot was taken.

So I guess I'm back to the fundamental question: Can I directly target the text "Login Window…" in the dropdown (i.e., similar to how one would click a particular menu item)?

There is a dedicated Keyboard Maestro Action called Fast User Switch I just tried it myself and it works as you want (i.e. when switching I can use my fingerprint to login).

Of course, you would need to have a version of this Macro in both User Accounts otherwise you wouldn't be able to switch back using the same technique... :grinning:


1 Like