| tell application "System Events" to tell process "Bear" | |
| set frontmost to true | |
| -- show all notes | |
| click menu item 1 of menu 1 of menu bar item 5 of menu bar 1 | |
| -- search in (all) notes | |
| click menu item 1 of menu 1 of menu item 22 of menu 1 of menu bar item 4 of menu bar 1 | |
| tell application "System Events" | |
| -- press delete to clear the search field | |
| key code 51 | |
| -- press tab to switch to note list | |
| key code 48 | |
| -- press cmd + home to move to the top of the note list | |
| key code 115 using { command down } | |
| end tell | |
| -- activate search again | |
| click menu item 1 of menu 1 of menu item 22 of menu 1 of menu bar item 4 of menu bar 1 | |
| end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
oderwat commentedOct 22, 2017
•
edited
Can be used like described here: http://blog.fosketts.net/2010/08/09/assign-keyboard-shortcut-applescript-automator-service/
This script is part of my Alfred 3 workflow BearHunter