Created
June 30, 2019 08:52
-
-
Save gouf/548c6e68263b86101207d7d23b20ef58 to your computer and use it in GitHub Desktop.
クリップボードにコピーされた値で Evernote のノートを検索する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alfred Workflow から利用することを想定 | |
# ユーザ指定の検索キーワードがクリップボードにコピーされていることを期待 | |
# NOTE: すでにアプリケーションが起動している必要がある | |
tell application "Evernote" | |
activate | |
delay 0.2 | |
# キーストロークをシステムイベントとして送信 | |
# NOTE: 適宜 delay を入れないと操作が速すぎて 受け付けてもらえない | |
tell application "System Events" | |
# 検索欄へのフォーカス操作を呼び出し | |
# クリップボードにコピーされた値を貼り付けて検索実行 | |
keystroke "e" using {command down, control down} | |
delay 0.5 | |
keystroke "v" using command down | |
delay 0.5 | |
keystroke return | |
delay 1.0 | |
# 「一旦タイトルにフォーカス → タブキー」で検索時のハイライト表示を解除 | |
keystroke "l" using {command down} | |
delay 0.3 | |
keystroke tab | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment