下面是 Raycast 调用 ChatGPT 的插件:
#!/bin/bash
# Raycast Script Command Template
#
# Duplicate this file and remove ".template." from the filename to get started.
# See full documentation here:
https://github.com/raycast/script-commands#
# Required parameters:
# @
raycast.schemaVersion 1
# @
raycast.title ChatGPT
# @
raycast.mode silent
#
# Optional parameters:
# @
raycast.icon 🕸️
# @
raycast.packageName 公孙二狗
# @
raycast.argument1 { "type": "text", "placeholder": "请输入内容进行搜索", "percentEncoded": false }
# 支持中文
export LANG="zh_CN.UTF-8"
export LANGUAGE="zh_CN.UTF-8"
export LC_ALL="zh_CN.UTF-8"
echo -n "$1" | pbcopy
open -a "ChatGPT" && osascript -e 'tell application "System Events"
-- delay 0.1
-- keystroke "n" using {command down} -- shortcut for "New Chat"
delay 0.2
keystroke "v" using {command down}
delay 0.3
keystroke return
end tell'