如何将 Alfred 的快捷指令迁移到 Raycast
原文 How to migrate Alfred snippets to Raycast
Update on 2023-12-13: Hugo is going to remove `--verbose` flag in the future, so we updated the snippet accordingly.I aim to migrate all my daily routines from Alfred to Raycast due to its more powerful extension support. Plus, to be honest I’ve never exploit the full potential of Alfred’s workflows though been a Powerpack purchaser for years.
The most frequent use scenario for me is to expand some snippets. Here is a list of my typical snippets.
Name | Keyword | Snippet |
---|---|---|
R assignment | ;; |
<- |
awesome git log | ;gitlog |
git log --graph --oneline --all --decorate --topo-order |
hugo server local | ;hugo |
hugo server --gc -D --disableFastRender --buildFuture |
Lorem sample text | ;lorem |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
markdown-image-insert | ;image |
<img class="special-img-class" style="width:100%" src="" /> |
R package requirement | ;require |
if (!require("pacman")) install.packages("pacman") pacman::p_load(package1, package2, package_n) |
Update all brew-casks-installed | ;cup |
brew cask list | xargs brew cask install --force |
Update all outdated brews… | ;bruo |
brew update && brew upgrade |
Bulk import
Honestly, it will be a pain to retype everything manually in Raycast. In David Brownman’s blog post Migrating Alfred Snippets to Raycast, he mentioned a relatively elegant way to bulk import snippets from Alfred to Raycast:
jq -s 'map(.alfredsnippet | {name, keyword, text: .snippet})' *.json > ../output.json
One last thing I don’t like about Raycast is there is no way to automatically synchronize settings between deivces. Instead, a manual export/import is required to keep everything update to date. Wish it could be implemented in the future.
以下为 GPT-4o 翻译内容:
2023-12-13 更新:Hugo 即将移除
--verbose
,因此我们也更新相印的脚本。
我的目的是吧所有目前的 Alfred 日常工作流从 Alfred 迁移到 Raycast 因为后者有更强大的拓展插件支持。另外,我觉得我一直以来都没有开发出 Alfred 的潜能,即便我很早就是 Powerpack 的用户了。
最常用的场景就是把一些脚本通过快捷指令的方式输入,以下是我的一些常用脚本列表。
名称 | 关键词 | 脚本 |
---|---|---|
R assignment | ;; |
<- |
awesome git log | ;gitlog |
git log --graph --oneline --all --decorate --topo-order |
hugo server local | ;hugo |
hugo server --gc -D --disableFastRender --buildFuture |
Lorem sample text | ;lorem |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
markdown-image-insert | ;image |
<img class="special-img-class" style="width:100%" src="" /> |
R package requirement | ;require |
if (!require("pacman")) install.packages("pacman") pacman::p_load(package1, package2, package_n) |
Update all brew-casks-installed | ;cup |
brew cask list | xargs brew cask install --force |
Update all outdated brews… | ;bruo |
brew update && brew upgrade |
批量导入
实话说,如果要手动录入一大堆可真是麻烦。David Brownman 的博文 Migrating Alfred Snippets to Raycast 中提到了一种相当优雅的方法来批量导入 Alfred 到 Raycast:
jq -s 'map(.alfredsnippet | {name, keyword, text: .snippet})' *.json > ../output.json
最后,我想说我不喜欢 Raycast 的一点是没有办法自动同步设定。只能通过手动导入导出来保持设定的一致。希望未来能实现这个功能。