sunrisewestern
V2EX  ›  macOS

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

  •  
  •   sunrisewestern · 2022년 12월 22일 · 2618 조회수
    1300일 지난 토픽입니다. 언급된 정보가 변경되었을 수 있습니다.

    之前用的别人提供的 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 답글    2022-12-28 13:13:29 +08:00
    Quanuanc
        1
    Quanuanc  
       2022년 12월 22일   ❤️ 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  
       2022년 12월 22일
    defaults write NSGlobalDomain com.apple.keyboard.fnState -bool true/false
    shervy
        3
    shervy  
       2022년 12월 22일
    非程序员完全看不懂。
    sunrisewestern
        4
    sunrisewestern  
    OP
       2022년 12월 22일
    @Quanuanc 虽然会弹出设置界面,但可以用,感谢
    sunrisewestern
        5
    sunrisewestern  
    OP
       2022년 12월 22일
    @Volekingsg 改这个 plist 好像不会立即生效
    Volekingsg
        6
    Volekingsg  
       2022년 12월 23일
    @sunrisewestern #5 确实,事前事后 kill 一些东西都没用,也不确定是不是我没找对
    ooops
        7
    ooops  
       2022년 12월 28일 via iPhone
    不如 karabiner 重新映射一套了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5810 온라인   최고 기록 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 02:05 · PVG 10:05 · LAX 19:05 · JFK 22:05
    ♥ Do have faith in what you're doing.