Turning Mouse Keys Off/On with Applescript

Apple has provided a means (5 taps on Option Key) to toggle Mouse Keys Off/On. I can successfully run this toggle in Applescript, but I can’t find any way to tell what the current state is. After the toggle, are Mouse Keys Off or are they On?

I’m trying to overcome this by GUI scripting the Accessibility/Mouse & Trackpad prefs to set or clear the Enable Mouse Keys Checkbox. This is the same thing that’s done by the 5 Option Key taps.

I’m having trouble with accessing that Checkbox. I tried Apple’s Probe Menu Bar script, but the name “Mouse Keys” doesn’t show up in the list of Menu items.

Either of these solutions would work for me:

  • Set the Checkbox to a known state (checked or unchecked, doesn’t matter)
  • Return the current state (so I can toggle it if necessary).

Any help would be much appreciated.

NO, this isn’t the same things. This is 2 individual levels of the security. See the answer HERE.