Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Little Script which tells Bear to focus the window, reset it's state and place the cursor in the search field
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
Owner

oderwat commented Oct 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment