全文摘自
http://wonderffee.github.io/blog/2015/06/04/improve-evernote-editing-capabilities-in-mac/
1、菜單里選”新建“,選取文稿類型“服務”;
2、在出來的窗口右側頂部設置“服務”收到選定的“文本”,位于”Evernote“,不要勾選”用輸出內容替換選中文本“
3、在左側選取“運行AppleScript”,雙擊或直接拖到右側區域內;
4、在出現的 AppleScript 編輯窗口里輸入代碼,之后保存為你喜歡的名字;
5、此時在系統左上角 Automator 的下拉菜單里“服務”一欄就已經有剛才你保存的服務啦!現在點擊剛剛保存的服務的名稱運行一次看看~~(一定要運行一次哦)
set appName to "Evernote"
-- if application appName is running then
tell application id (id of application appName)
activate
tell application "System Events"
keystroke "c" using command down
end tell
set selectedText to the clipboard as ?class utf8?
-- the clipboard as "HTML"
set the clipboard to "<span style=\"color:red;\">" & selectedText & "</span>"
set theHEX to do shell script "LC_ALL=en_US.UTF-8 pbpaste | hexdump -ve '1/1 \"%.2x\"'"
if theHEX is "" then
beep
else
run script "set the clipboard to ?data HTML" & theHEX & "?"
tell application "System Events"
keystroke "v" using {command down}
end tell
end if
end tell
-- end if
代碼保存在
/Users/yourusername/Library/Services/
現在開始設置快捷鍵。
1、點擊 Automator 下拉菜單中“服務->服務偏好設置”;
2、在彈出的服務偏好設置窗口右側,從“通用”中找到剛保存的服務名稱,選中該服務,右側可以看到“添加快捷鍵”的按鈕;
3、點擊“添加快捷鍵”按鈕,在鍵盤上按下需要設置的快捷鍵。
下載地址
鏈接: https://pan.baidu.com/s/1sl4LDLz 密碼: bd7u