sunrisewestern
V2EX  ›  macOS

macos 13 Ventura applescript 快速切换 f1 , f2, f3... 键功能

  •  
  •   sunrisewestern · Dec 22, 2022 · 2953 views
    This topic created in 1412 days ago, the information mentioned may be changed or developed.

    之前用的别人提供的 applescript 代码

    tell application "System Preferences"
    	set current pane to pane "com.apple.preference.keyboard"
    end tell
    
    tell application process "System Preferences"
    	repeat until exists tab group 1 of window "Keyboard"
    	delay 0.5
    	end repeat
    	click radio button "Keyboard" of tab group 1 of window "Keyboard"
    	try
    		click checkbox "Use F1, F2, etc. keys as standard function keys on external keyboards" of tab group 1 of window "Keyboard"
    	end try
    	try
                    click checkbox "Use F1, F2, etc. keys as standard function keys" of tab group 1 of window "Keyboard"
            end try
    end tell
    tell application "System Preferences" to quit
    

    但 macos 13 设置里这个选项的位置变了,之前的不能用了,有大佬知道怎么改吗

    7 replies  •  2022-12-28 13:13:29 +08:00
    Quanuanc
    Quanuanc
    Dec 22, 2022❤️1
    1
    如果你的系统语言是英文的,可以试试这个: https://www.icloud.com/shortcuts/ba6118a07c80470c934c52c95d29117e ,从这个帖子 https://www.reddit.com/r/shortcuts/comments/w8tnqa/automatic_fn_toggle_shortcut_for_mac_os_x_ventura/来的。
    如果你的系统语言是中文的,修改一下上面的脚本也能用,这是我修改的版本: https://www.icloud.com/shortcuts/7dde5bdd6c1e4c0dbd284d8cd7bb4660
    Volekingsg
    Volekingsg
    Dec 22, 2022
    2
    defaults write NSGlobalDomain com.apple.keyboard.fnState -bool true/false
    shervy
    shervy
    Dec 22, 2022
    3
    非程序员完全看不懂。
    sunrisewestern
    sunrisewestern
    OP
    Dec 22, 2022
    4
    @Quanuanc 虽然会弹出设置界面,但可以用,感谢
    sunrisewestern
    sunrisewestern
    OP
    Dec 22, 2022
    5
    @Volekingsg 改这个 plist 好像不会立即生效
    Volekingsg
    Volekingsg
    Dec 23, 2022
    6
    @sunrisewestern #5 确实,事前事后 kill 一些东西都没用,也不确定是不是我没找对
    ooops
    ooops
    Dec 28, 2022 via iPhone
    7
    不如 karabiner 重新映射一套了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3172 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 57ms · UTC 10:44 · PVG 18:44 · LAX 02:44 · JFK 05:44
    ♥ Do have faith in what you're doing.