0

我是 AppleScript 的新手,我正在尝试制作键盘快捷键来切换 Logitech K750 上的 Fn 键。我使用 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

4

3 回答 3

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 在下一个操作系统版本中更改首选项窗格的布局,此脚本可能不再起作用。

于 2016-04-08T05:21:10.577 回答
0

我知道这是一个老问题,这个答案并没有严格解决有关 AppleScript 的问题,但这个线程是在 Logitech K750 Solar Mac 键盘上切换 Fn 键的一般问题的顶级 Google 结果。

我为该一般问题找到的解决方案是安装新的Logitech Options实用程序。安装并打开后,选择键盘并切换使用所有 F1、F2 等键作为标准功能键旁边的复选框,以获得所需的 Fn 键功能。

于 2022-02-05T22:49:34.643 回答
-1

谢谢你,贝尔!但这仅适用于 Apple 键盘。我的是罗技 K750,Fn 键选项位于罗技的应用程序“罗技设备管理器”上。我已经设法让它工作,直到“罗技设备管理器”打开......所以,之后,我必须手动单击复选框......

罗技设备管理器

于 2016-04-08T17:31:08.237 回答