Closed sballin closed 4 years ago
Came up with this neat way to clear a search before displaying the requested note:
tell application "System Events"
tell process "Notes"
try
-- If cancel button is present, user has done a search that needs to be cleared
-- Note: breaks if you set a variable to refer to the text field
-- Note: assumes default toolbar layout
if number of buttons in text field of group 5 of toolbar 0 of window 0 is 2 then
click button 2 of text field of group 5 of toolbar 0 of window 0
key code 48 -- tab to unfocus text field
end if
end try
end tell
end tell
...
show note id q in default account
...
But the simpler and more robust solution is...
show note id q in default account
show note id q in default account
Fixed as of version 2.2.0.
To reproduce: