AppleScript K750切换Fn键

时间:2016-04-07 19:12:07

标签: applescript keyboard-shortcuts logitech

我是AppleScript的新手,我正在尝试使用键盘快捷键来切换Logitech K750上的Fn Keys。我使用AutoCAD并且确实需要它。

我开始尝试一些代码,但直到现在都没有成功......任何人都可以帮助我吗?

这是代码......

谢谢!!!

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

2 个答案:

答案 0 :(得分:0)

此脚本单击功能键复选框。

在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

警告:GUI脚本取决于当前系统版本。如果Apple在下一个操作系统版本中更改首选项窗格的布局,则此脚本可能不再有效。

答案 1 :(得分:-1)

谢谢你,pbell! 但这只适用于Apple键盘。 我的是Logitech K750,Fn Key选项位于Logitech设备管理器&#34 ;,来自Logitech的应用程序。 我已经设法让它一直工作到#34; Logitech设备管理器"打开...所以,之后,我必须手动点击复选框...

Logitech Device Manager