最近在很多平台上看到 Raycast 的推荐文章, 今天就尝试了一下, 发现确实不错, 完全可以替代我目前对 Alfred 的使用, 甚至很多地方做得更好, 所以本文就是介绍我使用 Raycast 的一些效果(多图预警), 方便那些还没有接触这个软件的人对它有个了解, 如果有插件推荐, 欢迎在评论区进行讨论。
Raycast 是 MacMac 平台独占的效率工具, 主要包含如下功能:
应用启动
文件查找
窗口管理
剪贴板历史
Snippets
应用菜单查询
插件扩展功能
翻译
斗图
结束进程
查询端口占用
查询ip
除此之外, Raycast提供的在线插件商店, 可以很方便的进行功能扩展
Raycast官网: https://www.raycast.com/
核心功能
应用启动:
并且支持卸载应用, 找到应用, cmd+k 打开操作菜单, 下拉到最后.
文件查找
窗口管理
剪贴板历史
推荐使用 Clipboard History 这个扩展,和 Alfred 的一样, 并且有分类,效果如下
设置快捷键 cmd+shift+v
Snippets
通过 Snippets 可以保存自定义片段, 通过关键字快速查询并输出到光标处, 如常用语、 邮箱、手机号、税号、代码片段等等
创建 Snippets 可以通过搜索 Create Snippet, 搜索 Snippets 可以通过搜索Search Snippet
应用菜单查询
查询当前激活应用的所有菜单, 不限层级. 可以通过搜索 Search Menu Items 来查询。
推荐插件
Easydict(翻译软件)
超强的翻译软件, 完美替代我在 Alfred 的 workflow 中配置的有道翻译, 我配置了如下功能
输入中文, 自动翻译成英文
输入英文, 自动翻译成中文
支持一键发音
Open AI 翻译长文本
Doutu
表情包查询,选中回车就复制到剪贴板了, 就可以粘贴到 Discord/QQ/Wechat 斗图了, 非常方便。
Kill Process
关键字查询, 并一键结束进程
Kill Port
查询端口占用的进程, 并支持一键结束进程
MyIp
查询当前ip
-----------------------------------------------------------------------------------------------------------------------
Script Commands let you tailor Raycast to your needs. Think of them as little productivity boosts throughout your day.
Raycast lets you control your tools with a few keystrokes and installing script commands makes it possible to execute commands from anywhere on your desktop. They are a great way to speed up every-day tasks such as converting data, opening bookmarks or triggering dev workflows. This repository contains some example scripts as well as links to our community commands and documentation to write your own ones.
✨ Looking to build richer extensions? Check out the Extensions API here.
🚨 For anything that is not related to script commands, please send us an email, use the feedback command within Raycast, or join the Slack community.
To install new commands, follow these steps:
-
Choose a script from the community repo and save it into a new directory.
Scripts containing the word
.template.in the filename require some values to be set (check the troubleshooting section for more information).Alternatively, instead of creating a new directory you can reuse the repo's
_enable-commandsfolder. -
Open the Extensions tab in the Raycast preferences
-
Click the plus button
-
Click
Add Script Directory -
Select directories containing your Script Commands
💡 Hint: We recommend that you don't directly load the community script directories into Raycast to avoid potential restructuring and new script commands suddenly appearing in Raycast.
To write your own custom Script Commands, go over the following steps:
- Use the
Create Script Commandfunctionality in Raycast - Write and edit your script using your favourite code editor
- Run your Script Command from the Raycast root search
💡 Hint: If you choose to write your script in Bash, we highly recommend using the Shellcheck
linter as this will ensure smooth running of your script. All scripts
uploaded to GitHub will need to have been run through ShellCheck.
These parameters are available for you to customize your Script Command in Raycast. For practical examples of how these should be used, as well as best practices and supported languages, please browse our templates and community-built scripts.
| Name | Description | Required | App Version |
|---|---|---|---|
| schemaVersion | Schema version to prepare for future changes in the API. Currently there is only version 1 available. | Yes | 0.29+ |
| title | Display name of the Script Command that is shown as title in the root search. | Yes | 0.29+ |
| mode | Specifies how the script is executed and how the output is presented. Details of the options for this parameter can be viewed here | Yes | 0.29+ |
| packageName | Display name of the package that is shown as subtitle in the root search. When not provided, the name will be inferred from the script directory name. | No | 0.29+ |
| icon | Icon that is displayed in the root search. Can be an emoji, a file path (relative or full) or a remote URL (only https). Supported formats for images are PNG and JPEG. Please make sure to use small icons, recommended size - 64px. | No | 0.29+ |
| iconDark | Same as icon, but for dark theme. If not specified, then icon will be used in both themes. |
No | 1.3.0+ |
| currentDirectoryPath | Path from which the script is executed. Default is the path of the script. | No | 0.29+ |
| needsConfirmation | Specify true if you would like to show confirmation
alert dialog before running the script. Can be helpful with destructive
scripts like "Quit All Apps" or "Empty Trash". Default value is false. |
No | 0.30+ |
| refreshTime | Specify a refresh interval for inline mode scripts in seconds,
minutes, hours or days. Examples: 10s, 1m, 12h, 1d. Note that the actual
times can vary depending on how the OS prioritises scheduled work. The
minimum refresh interval is 10 seconds. If you have more than 10 inline
commands, only the first 10 will be refreshed automatically; the rest
have to be manually refreshed by navigating to them and pressing return. |
No | 0.31+ |
| argument[1...3] | Custom arguments, see Passing Arguments page for detail of how to use this field | No | 1.2.0+ |
| author | Define an author name to be part of the script commands documentation | No | |
| authorURL | Author social media, website, email or anything to help the users to get in touch | No | |
| description | A brief description about the script command to be presented in the documentation | No |
You can use the standard output to present messages in Raycast. Depending on the mode, the standard output of your scripts is differently presented.fullOutput and inline modes support ANSI Escape codes allowing to color generated output by changing its background and foreground color. You can view the different output mode options as well as their various forms and color options here.
If the script exits with a status code not equal to 0, Raycast interprets it as failed and shows a toast that the script failed to run. If this script has inline or compact mode, the last line of the output will be used as an error message. Consider this example for a bash script:
if ! [[ $value =~ $regex ]] ; then
echo "Invalid value provided"
exit 1
else
...We're always looking for new Script Commands or other ways to improve Raycast. If you have anything cool to show, please send us a pull request. If we screwed something up, please report a bug. Join our Slack community to brainstorm ideas with like-minded folks.
from https://github.com/raycast/script-commands



No comments:
Post a Comment