Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gouf
Created June 30, 2019 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gouf/548c6e68263b86101207d7d23b20ef58 to your computer and use it in GitHub Desktop.
Save gouf/548c6e68263b86101207d7d23b20ef58 to your computer and use it in GitHub Desktop.
クリップボードにコピーされた値で Evernote のノートを検索する
# 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