alfred/README.md
2026-03-28 19:27:32 +08:00

25 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Alfred Workflow
## 打包
```shell
make
```
## 测试
```markdown
* 打开 Alfred → 点击左侧「Workflows」→ 右下角「+」→ 新建一个空白 Workflow
* 给 Workflow 命名比如「Command Hub」设置标识符唯一即可
* 添加「Trigger」触发方式
右侧点击 ---> Inputs ---> Script Filter
设置关键词(比如 m勾选「with space」输入关键词后按空格输入参数
添加「Run Script」执行脚本/Users/xxx/xxx/alfred-micah-workflow $1 $2 $3 $4 $5 $6 $7 $8
从 Trigger 拖出连线,选择 Actions → Run Script
「Language」选择「/bin/bash」
脚本内容填写:/path/to/your/alfred-micah-workflow "$1" "$2"(替换为你编译后的可执行文件绝对路径,$1 是 Alfred 传入的输入参数);
勾选「with input as argv」
可选添加「Copy to Clipboard」选中后复制
从 Run Script 拖出连线,选择 Actions → Copy to Clipboard
「Clipboard」选择「Argv」即我们代码中 Arg(url) 传递的参数);
保存后,在 Alfred 输入 gtest go就能看到匹配的结果选中后会自动复制对应的 URL 到剪贴板。
```