I’ve discovered that my previous attempt to automate Radium doesn’t entirely work. If my password-protected screensaver was running when the script ran my keyboard would become unresponsive. It seems that disabling the password using
set require password to wake of security preferences to true somehow causes the keyboard to remain ‘captured’ by ScreenSaverEngine (apparently this also happens as far back as 10.9).
The only way I’ve found to work around this is to actually simulate typing the password. Not very elegant, but it seems to be the only method that still works.
Replace all of the ‘XX’s in the snippet below with the correct code for the letters of your password. You’ll have to experiment a bit with this. My password is all lower case letters and symbols. The key codes themselves seem to be case-insensitive – i.e. the key code for ‘B’ is 11 but when typed it is a lower-case ‘b’. I’m guessing you have to type a modifier key at the same time to simulate caps.
If you experiment with this, you may want to create a small AppleScript app containing the code below, and put it in your Dock. The reason is that re-enabling the password and turning the screensaver on will completely fix the ‘captured’ keyboard problem. However when you encounter the keyboard capture issue you’ll find you cannot launch applications by double-clicking them, or activate the screensaver via a screen-corner hotspot. This makes re-starting the screensaver difficult. All the script does is re-enable the password and turn the screensaver on.