Crate a shortcut that opens a PDF with search terms

Hello!

I love the possibility of being able to know if a search term is in a PDF inside Bear 2.0 beta. I am trying to save some steps from opening the PDF in my default app and then doing the search. I was wondering if it is possible to have a shortcut that would take my search term from inside Bear and open the file in question and perform the search. Is this possible?

Thanks!

I’m sure that others here might have more elegant solution that mine, but I narrow my search by using Find<note search list and then enter .pdf to generate a list of every note containing a pdf. If I know the topic (#tag) I can narrow the search even further. That’s my hack for doing such a search in Bear. Wondering what others might do from within Bear (and not employing an extra utility).

Assuming we’re talking about the Mac version, something should be possible with an app like Keyboard Maestro or BetterTouchTool. Maybe even plain AppleScript.

Something like the following sequence:

  1. Switch back to Bear
  2. Send Cmd Shift F to focus the note search field
  3. Cmd C to copy to clipboard, maybe parse it to isolate the search keywords from any Bear-specific operators
  4. Switch back to the pdf viewer
  5. Cmd F to open search, cmd V paste, enter

Then there’s the question of how to trigger it. A keyboard shortcut is easy enough with the tools mentioned above, but it might be interesting to create an Automator app or service. Then, theoretically, you could right click the PDF thumbnail in Bear and select “Open and continue search in Preview” from the Open In, or Services menus.

Thanks for your thoughts. Again, what I am trying to accomplish is when I do a search in Bear and in my results it says that it found the text within the PDF, I would like to open up the PDF directly attached in the note and have it open up and upon opening, perform the search for the term I just used in Bear. The end result would be a better workflow as I wouldn’t have to search twice.

Perhaps, with the contextual menu on the PDF, I could run a service? That might be the easiest. Anyone know how to grab the current search criteria in Bear via Automator? Thanks for the ideas!

Hey!

I did try playing around with this and just wasn’t able to use the thumbnail to get the proper trigger. I used Keyboard Maestro but wasn’t to get a workflow that would work. Thanks for the suggestion!