V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
sunrisewestern
V2EX  ›  macOS

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

  •  
  •   sunrisewestern · Dec 22, 2022 · 2360 views
    This topic created in 1222 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
        1
    Quanuanc  
       Dec 22, 2022   ❤️ 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
        2
    Volekingsg  
       Dec 22, 2022
    defaults write NSGlobalDomain com.apple.keyboard.fnState -bool true/false
    shervy
        3
    shervy  
       Dec 22, 2022
    非程序员完全看不懂。
    sunrisewestern
        4
    sunrisewestern  
    OP
       Dec 22, 2022
    @Quanuanc 虽然会弹出设置界面,但可以用,感谢
    sunrisewestern
        5
    sunrisewestern  
    OP
       Dec 22, 2022
    @Volekingsg 改这个 plist 好像不会立即生效
    Volekingsg
        6
    Volekingsg  
       Dec 23, 2022
    @sunrisewestern #5 确实,事前事后 kill 一些东西都没用,也不确定是不是我没找对
    ooops
        7
    ooops  
       Dec 28, 2022 via iPhone
    不如 karabiner 重新映射一套了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5758 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 66ms · UTC 07:00 · PVG 15:00 · LAX 00:00 · JFK 03:00
    ♥ Do have faith in what you're doing.