0

I'd like to create an apple script that sends the computer to the lock screen and disables the keyboard for 60 seconds.

This is what I have so far

  1. Lock the keyboard entries with KeyboardCleanTool
  2. Go to the lock screen with do shell script "'/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession' -suspend"
  3. Unlock the keyboard entries by running tell application "KeyboardCleanTool" to quit

Unfortunately, it appears that KeyboardCleanTool does not enforce the keyboard lock while the lock screen is on.

Is there another way that I can prevent users from typing on the lock screen for sixty seconds?

One solution that Im considering is to replace step 1 with sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ and replace step 3 with sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/.

I don't know whether Apple Script can run programs while the lock screen is on (though I suspect not)

You must log in to answer this question.

Browse other questions tagged .