Trying to activate app after wake up

Agreed with that, but even though running, the engine won't be able to send keystrokes if the GUI is locked, right?

-rob.

Wrong.

Huh, didn’t know that.

-rob.

So essentially it sounds like there is no feasible way to wake my mac from sleep and put MS Teams into Busy status.

You could change your settings to automatically log in, but that comes with obvious risks.

@meebee I run a macro that is triggered using a remote trigger. In the macro I have these actions that log me in to my sleeping mac using a password saved in the Mac keychain.
image
You can set the password using the Mac Passwords app and in my case adding my login password called AutoLoginTest.

I have cats that sometimes walk on the keyboard while the Mac is asleep, so I add a bunch of delete keystroke actions before trying to login to make certain that the password field is cleared before the Insert text by typing action.

I use this method to run my morning home automation scenes and also start playing my chill music to start the day. When I get to the computer it is logged in and ready to go.

1 Like

Interesting, but I'm not quite sure how to type that password into the login screen. Is there some KM command to feed it into the password field on the login screen?

I suspect there's a huge difference between being logged out and seeing a screen lock while you are logged in. These are totally different things. KM can not run when you are logged out, but it can run when the screen is just locked. You need to distinguish between these two situations.

I think you're trying to get KM to run while you are logged out. That would be impossible.

You can if you "Send To..." the application in the action's options. If you don't specify an app the keystrokes go to the login dialog, as in @cyoungers macro above.

Which is moot in this case. While you can, when the screen is locked, activate Teams's "search" box and type in /busy

image

...you won't get the "matching items" list displayed, there's nothing to select, and so

image

...does nothing.

For Teams, perhaps because it's a web app pretending to be a real one, it looks like the screen will have to be unlocked.

It's the exact action in @cyoungers's screen shot -- "Insert text by typing". When you are at screen unlock and don't specify an app to type into (the default for that action) the keystrokes will be typed in the password box. The trick is saving your login password as a Keychain item, so you can retrieve it in your macro with the "Set Variable to Keychain Password" action.

As @Airy says, all this does depend on you being logged in and at the unlock screen rather than you being logged out of your machine...

Ok, I think I made progress. If I turn off the password required after sleep, then the macro works. I was not able to do that before since apparently iPhone Mirroring does not allow you to bypass the lock screen with password. And I wasn't able to really make cyoungers macro enter the password directly into my lock screen (and yes, my Mac was on screen lock not logged out).
So it's working as long as I don't require a password when logging back in after sleep. I'll have to think about how I feel about that security risk.

I'm not sure why iPhone mirroring is an issue. If your machine is off, iPhone mirroring won't restore itself when you turn the machine back on, so I'm not sure why you are expecting it to restore itself without a password.

There's a third option you might not have considered. Your Mac can also be configures to unlock if you are authenticated to your Apple Watch.

I'm not sure why iPhone mirroring is an issue. If your machine is off, iPhone mirroring won't restore itself when you turn the machine back on, so I'm not sure why you are expecting it to restore itself without a password.

Settings will not let me sign in without a password while iphone mirroring is on.

There's a third option you might not have considered. Your Mac can also be configures to unlock if you are authenticated to your Apple Watch.

For some reason, that's not a reliable option. Sometimes my AW doesn't open it, and I'm forced to have to type the password in. Not sure why it works sometimes and other times not.

In any case, I was finally able to make progress on cyounger's recommendation, and it nows lets me auto-enter my password in the lock screen after waking from sleep. It's still a security risk, but not as much as not having the log in screen present. I may tighten the window so that the macro only types in the screen password during a short period.