Thursday, December 13, 2018

#1 2008-05-02 01:10:50 pm

ladybug118
Member
Registered: 2008-03-21
Posts: 5

Toggle Full Keyboard Access All Controls w/out using Control+F7?

I've been using Control+F7 to toggle Full Keyboard Access - 'All Controls' vs 'Text Boxes And Lists Only' (located in Keyboard & Mouse preferences) in my AppleScripts in order do do some GUI scripting for some "non-scriptable" applications.  Problem is, sometimes I am actually toggling it OFF instead of ON if for some reason it was already on before running the script.  Much mayhem ensues in that situation, I assure you :-)

Is there a way to say something like "Turn Full Keyboard Access All Controls ON" in AppleScript??  This needs to work in 10.3, 10.4, and 10.5.

Thanks!

Offline

 

#2 2008-05-03 08:53:38 am

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11526
Website

Re: Toggle Full Keyboard Access All Controls w/out using Control+F7?

Hi,

try this

Applescript:


do shell script "defaults write .GlobalPreferences AppleKeyboardUIMode -int 2" -- all controls

or

Applescript:


do shell script "defaults write .GlobalPreferences AppleKeyboardUIMode -int 0" -- text boxes and lists only


regards

Stefan

Offline

 

#3 2018-12-05 01:11:04 pm

Riku
Member
Registered: 2016-05-23
Posts: 43

Re: Toggle Full Keyboard Access All Controls w/out using Control+F7?

Sorry to wake this up from the dead but I'm looking for this solution for exactly the same reason as the thread starter and was hoping that there would be some nice shell script for it.

StefanK, running those scripts one at a time, I don't get an error message nor any other response than "", but I don't see the setting changing in the System Preferences window. I'm on Yosemite, maybe those scripts no longer work? Is there a more up to date equivalent to this?
Even if toggling itself wasn't possible, a method to at least check on its current state would be very helpful because then you can use that information to decide whether or not you want to proceed to emulate the keyboard shortcut that toggles the state.

Edit: Okay great, I was too hasty and the scripts DO still toggle the state! I was just looking at the System Preferences window next to ScriptEditor window expecting to see the change, but nothing happened. I also went back to the main System Preferences window and to the Keyboard tab because in my experience some things that don't update immediately finally do if you just reload the tab that way. But apparently in this occasion you don't see the setting until you close System Preferences entirely and relaunch it. Sorry, I'd just never encountered this behavior before in any other context so it really looked like it wasn't doing anything.
Since that line of script is so short, the act of checking on current state would be more hassle than just giving the command no matter what, so this will do. smile
Thanks StefanK, still relevant tips!

Last edited by Riku (2018-12-05 01:17:30 pm)

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)