Keyboard Booby Trap Macro?

Hi all,

I'd like to make a security macro that locks my mac if a specific key is not pressed, after a specific amount of time.

The fundamental question is, what is the best trigger to use for this?

I don't own an Apple Watch and locking/unlocking my laptop constantly makes me itch. So with such macro, I could feel less worried about leaving my laptop unlocked while at work.

I would have tried devising something myself, though I've never had much success in creating macros that trigger after a certain amount of time.

Hope you can stir me in the right direction.

Here are two macros that work together:

Booby Trap.kmmacros (39.4 KB)

Screenshot: Booby Trap - Reset

This resets the sleep timer (below) and is triggered manually by hitting a hotkey (change as desired) and automatically whenever the computer wakes from sleep.

Screenshot: Booby Trap - Sleep

This pauses for a user-defined interval (change as desired) before putting your mac to sleep, and is triggered by the first macro.

Thanks for the input! That's pretty smart.

So the above macro tiggers only after the laptop wakes up from sleep, correct?

What about activating the trap after 3 minutes of idle time?

Waking triggers the timer but so does hitting the hotkey. Each time it triggers, the timer resets. If the pause expires without being retriggered, the system sleeps.

If you usually take your phone with you when you leave your desk, you might also be interested in Nearlock. Apparently, the free version should suffice, athough I haven't tried it myself.

Thanks, that app looks neat. I will give it a go.

Good to know that I'll have your macro to rely on if Nearlock doesn't make me happy!

1 Like

I have been using nearlock for a bit now, and I have to say my experience hasn't been overwhelmingly positive with it

1 Like