V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Nathanzheng
V2EX  ›  问与答

求一个关闭/打开 Fn 功能键的 Workflow,

  •  
  •   Nathanzheng · 2017-03-27 15:22:13 +08:00 · 1493 次点击
    这是一个创建于 2598 天前的主题,其中的信息可能已经有所发展或是发生改变。

    或者告诉我怎么做也行

    4 条回复    2017-03-27 18:43:43 +08:00
    minamike
        1
    minamike  
       2017-03-27 17:17:42 +08:00   ❤️ 1
    如果是 mac 的话可以用 AppleScript
    ```
    tell application "System Preferences"
    set current pane to pane "com.apple.preference.keyboard"
    end tell


    tell application "System Events"
    if UI elements enabled then
    tell tab group 1 of window "Keyboard" of process "System Preferences"
    click checkbox "Use F1, F2, etc. keys as standard function keys"
    end tell
    else
    tell application "System Preferences"
    set current pane ¬
    to pane "com.apple.preference.universalaccess"
    display dialog ¬
    "UI element scripting is not enabled. Check \"Enable access for assistive devices\""
    end tell
    end if
    end tell

    tell application "System Preferences"
    quit
    end tell
    ```
    Alfredworkflow : https://github.com/packal/repository/blob/master/com.tanseycg.togglefunctionkeys/toggle_function_keys.alfredworkflow
    Nathanzheng
        2
    Nathanzheng  
    OP
       2017-03-27 18:35:05 +08:00
    @minamike 请问怎么用啊, Keyword 是什么
    minamike
        3
    minamike  
       2017-03-27 18:42:13 +08:00
    @Nathanzheng 你时用的 Alfred 的吗 keyword 就是运行这个命令的关键词啊
    你用快捷键呼出 alfred 窗口输入设定的 keyword 就可以运行这个命令
    也可以直接用快捷键啊 两者任选一个就可以
    Nathanzheng
        4
    Nathanzheng  
    OP
       2017-03-27 18:43:43 +08:00
    @minamike 没有用啊
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3865 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 10:37 · PVG 18:37 · LAX 03:37 · JFK 06:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.