Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBener committed Oct 12, 2022
0 parents commit 05c7ecb
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Tom Ben

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# AutoCorrect Extension for PopClip

基于 [AutoCorrect](https://github.com/huacnlee/autocorrect) 的 PopClip 插件,用于「自动纠正」或「检查并建议」文案,给 CJK(中文、日语、韩语)与英文混写的场景,补充正确的空格,纠正单词,同时尝试以安全的方式自动纠正标点符号等等。

## 安装

1. **安装 PopClip**

- 前往 [官网](https://pilotmoon.com/popclip/) 下载,可以免费试用
- 或在 [Mac App Store](https://apps.apple.com/app/popclip/id445189367) 中购买,售价 $14.99(¥98.00)

2. **安装 AutoCorrect**

通过 [Homebrew](https://brew.sh/) 安装:

```shell
brew install autocorrect
```

或者使用 [Curl](https://curl.se/) 安装:

```shell
curl -sSL https://git.io/JcGER | bash
```

3. **安装 AutoCorrect Extension for PopClip**

鼠标选中下方 6 行 YAML 代码块后,PopClip 开启状态下会自动弹出提示 `Install Extension "AutoCorrect"`,点击即可安装。在 M* 芯片的 Mac 上,使用 Homebrew 安装的 AutoCorrect 路径为 `/opt/homebrew/bin/autocorrect`。如果 AutoCorrect 在你的 Mac 中不是此路径,请在终端中输入 `which autocorrect`,然后用输出结果替换下方的 `/opt/homebrew/bin/autocorrect`。请注意,可执行的文件的路径不可省略。

```yaml
# popclip AutoCorrect
name: AutoCorrect
title: CJK Formatting
icon: square CJK
applescript: do shell script "export LANG='en_US.UTF-8' && /bin/echo '{popclip text}' | /opt/homebrew/bin/autocorrect --stdin"
after: paste-result
```
或者下载
## 使用效果
![demo](https://p15.p3.n0.cdn.getcloudapp.com/items/5zuPjPbb/f877d3ec-3d4a-4e2d-a07f-8716f80c23e9.gif)
## 相关项目
- [盘古之白 PopClip 插件](https://github.com/mousepotato/pangu-space.popclipext)
## License
[MIT license](LICENSE)
31 changes: 31 additions & 0 deletions autocorrect-popclip/Config.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Actions</key>
<array>
<dict>
<key>After</key>
<string>paste-result</string>
<key>Image File</key>
<string>autocorrect.png</string>
<key>Requirements</key>
<array>
<string>copy</string>
</array>
<key>Shell Script File</key>
<string>autocorrect.sh</string>
<key>Stoppable</key>
<false/>
<key>Title</key>
<string>Formatting CJK</string>
</dict>
</array>
<key>Extension Identifier</key>
<string>com.tomben.autocorrect.extension</string>
<key>Extension Name</key>
<string>AutoCorrect</string>
<key>Extension Description</key>
<string>Improve copywriting, correct spaces, words, punctuations between CJK (Chinese, Japanese, Korean).</string>
</dict>
</plist>
Binary file added autocorrect-popclip/autocorrect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions autocorrect-popclip/autocorrect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export LANG='en_US.UTF-8' && /bin/echo -n "$POPCLIP_TEXT" | /opt/homebrew/bin/autocorrect --stdin

0 comments on commit 05c7ecb

Please sign in to comment.