'AppleScript K750 Toggle Fn Keys

I'm new on AppleScript, and I'm trying to make a keyboard shortcut to toggle Fn Keys on my Logitech K750. I use AutoCAD and really need it.

I started to to try some codes, but till now no success... can anybody help me?

Here is the code...

Thank you!!!

tell application "Device Manager" activate end tell tell application "Device Manager" get every attribute of checkbox "When this box is checked, press F1, F2, etc. keys to use the standard function keys, and press and hold the Fn key to use the enhanced functions printed on the keys." of window "Wireless Solar Keyboard K750 for Mac" click checkbox "When this box is checked, press F1, F2, etc. keys to use the standard function keys, and press and hold the Fn key to use the enhanced functions printed on the keys." of window "Wireless Solar Keyboard K750 for Mac" activate if value of checkbox "When this box is checked, press F1, F2, etc. keys to use the standard function keys, and press and hold the Fn key to use the enhanced functions printed on the keys." of window "Wireless Solar Keyboard K750 for Mac" = 0 then display dialog "Standard Function Keys off..." giving up after 1 else display dialog "Standard Function Keys on..." giving up after 1 end if end tell tell application "Device Manager" quit end tell



Solution 1:[1]

This script clicks on the function key checkbox.

It is tested and OK on ElCapitain (10.11):

tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.keyboard"
reveal anchor "keyboardTab" of current pane
end tell
delay 0.5 -- to make sure system has time to open the window !
tell application "System Events"
tell application process "System Preferences" to click checkbox 1 of tab group 1 of front window
end tell
tell application "System Preferences" to close front window

Warning : the GUI scripting depends of the current system version. If Apple change the layout of preferences panes in next OS version, this script may no longer work.

Solution 2:[2]

I know this an old question, and this answer doesn't strictly address the question about AppleScript, but this thread was a top Google result for the general issue of toggling the Fn key on the Logitech K750 Solar Mac keyboard.

The solution I found for that general issue was to install the new-ish Logitech Options utility. Once that's installed and open, select the keyboard and toggle the checkbox next to Use all F1, F2, etc. keys as standard function keys to get your desired Fn key functionality.

Solution 3:[3]

Thank you, pbell! But that works only with an Apple Keyboard. Mine is a Logitech K750, and the Fn Key option is located on "Logitech Device Manager", an app From Logitech. I've managed to make it working till when the "Logitech Device Manager" opens... so, after, I have to manually click on the check box...

Logitech Device Manager

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 pbell
Solution 2 jhale1805
Solution 3 prcmelo