Created
October 22, 2017 11:50
-
-
Save oderwat/f87cdb53a559a1bd3fb31a59891eaa9f to your computer and use it in GitHub Desktop.
Little Script which tells Bear to focus the window, reset it's state and place the cursor in the search field
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
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
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