Jump to content

New Bear Alfred Workflow


Recommended Posts

I've created a new Bear Alfred workflow here:
https://github.com/drgrib/alfred-bear


It is faster compared to the current Bear Alfred workflow because it is written in Go instead of Python and has optimized SQL queries. It also adds tag searching and autocompletion, link pasting, and clipboard content to note on creation. I do appreciate the author of the original Bear Alfred workflow because I started mine from his design.

Link to comment
  • 3 months later...

This is a very neat idea! Unfortunately when I try to search anything using the 'bs' shortcut I get a Mac OS popup telling me that "search" is from an unidentified developer and that I can movie it to trash ;) the search does not complete. I wonder If you can circumnavigate this problem, it would be awesome to have a Bear autocompletion in the search.

 

Link to comment
1 hour ago, mattjabbar said:

This is a very neat idea! Unfortunately when I try to search anything using the 'bs' shortcut I get a Mac OS popup telling me that "search" is from an unidentified developer and that I can movie it to trash ;) the search does not complete. I wonder If you can circumnavigate this problem, it would be awesome to have a Bear autocompletion in the search.

 

 

Catalina? Its because its not signed, you can allow this app from the Security preferences

Link to comment
  • 3 months later...

This is great. But when I open a new note, it opens in a window sized to my entire screen. Is there a way to open it within the existing editor window, or at least in a window that size? Bear's default behavior when I open a note in a new window is one the same size as the editor.

Link to comment
  • 4 weeks later...
  • 2 months later...

Hi, Everytrhign works great, and autocomplete for Tag search is awesome (I have a large number of 'people' tags to keep track of)

 

i experienced a few missing searches for Tags which have spaces: 

  • Returns results               = BS #Area/Application
  • Does not return results = BS #Area/Test Name

I tried wrapping tags with #, but still no change. 

 

If i go in and edit tag to be 'Test_Name'. (BS #/area/Test_Name) then the results show. 

 

Perhaps, I shouldn't be using spaces in my tag names, but it does make it easier to read sometimes. 

Link to comment
  • 1 month later...

Hi, I'm a complete novice to Alfred and can't code. Have been, without success, trying to create a workflow that does following:

 

Typing:

bl 7

 

Would open Bear with 

@last7days

filled into search box, in order to see only notes of the last 7 days.

 

Edit: Found solution: Web search instead of workflow.

Search URL: bear://x-callback-url/search?term=%40last{query}days

Title: Bear last x days

Keyword: bl

Edited by chrs
solution found
Link to comment
  • 3 months later...
  • 2 months later...

I absolutely love your workflow, thank you very much for posting it.

 

I only have one more need and I hope you can help me, because I am lost in code/at coding. :)

 

The only other thing I am looking for, is to have a shortcut key that opens Bear, opens a new note (not in a new window) and I can type my note.

 

I have been trying to look at the code, I manage to connect the shortcut, but every time the Alfred window opens up first to ask for an input and I cannot stop this (or if I try to, nothing happens.)

 

I guess it's not that complicated, but I have absolutely no clue how to do it. :X 

 

 

Whether you can help me or not, thank you all for your time and all your work here. 

Stay safe.

 

Link to comment
  • 3 months later...

I'm fairly new to Bear, but this workflow is pretty amazing! I was wondering if there'd be a way to add text to an already created note from within Alfred, WITHOUT opening Bear App. Just for quickly saving thoughts without any distraction on-the-go.

 

 

The closest I've gotten is to use a keyword+argument that opens "bear://x-callback-url/add-text?text={query}&id=..." but no matter what it'll open the app and it kind of defeats the purpose of adding content without any distraction.

 

Link to comment
  • 1 month later...
On 7/4/2021 at 4:24 AM, gloogloo said:

I'm fairly new to Bear, but this workflow is pretty amazing! I was wondering if there'd be a way to add text to an already created note from within Alfred, WITHOUT opening Bear App. Just for quickly saving thoughts without any distraction on-the-go.

 

 

The closest I've gotten is to use a keyword+argument that opens "bear://x-callback-url/add-text?text={query}&id=..." but no matter what it'll open the app and it kind of defeats the purpose of adding content without any distraction.

 

 

use this 

 

bear://x-callback-url/add-text?id={var:id_tile}&selected=no&mode=append&new_line=yes&open_note=no&show_window=no&edit=no&text=%0A%0A%3E%20{query}

 

open_note = no

 

it will append a new line on note without open window note itself. If you using url scheme you still open the bear app, but you can hide or minimize it

Edited by afridho
Link to comment
  • 1 year later...

hello, great workflow for searches. Thank you VERY much ! Does not work if I want to create new notes with BN or BNEW. Uses the note title and tag to run a google search. Would you have any suggestions ? thank you very much !

 

CleanShot2023-05-03at20_50.11@2x.thumb.png.fd7a7f6fe0392ab5706dda0038acde25.png

 

[20:48:16.590] Bear[Script Filter] Queuing argument 't'
[20:48:16.605] Bear[Script Filter] Script with argv '(null)' finished
[20:48:16.607] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:16.831] Bear[Script Filter] Queuing argument 'th'
[20:48:16.837] Bear[Script Filter] Script with argv '(null)' finished
[20:48:16.840] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:16.938] Bear[Script Filter] Queuing argument 'thi'
[20:48:16.951] Bear[Script Filter] Script with argv '(null)' finished
[20:48:16.952] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:17.154] Bear[Script Filter] Queuing argument 'this'
[20:48:17.169] Bear[Script Filter] Script with argv '(null)' finished
[20:48:17.173] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:17.329] Bear[Script Filter] Queuing argument 'thisi'
[20:48:17.336] Bear[Script Filter] Script with argv '(null)' finished
[20:48:17.342] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:18.204] Bear[Script Filter] Queuing argument 'this'
[20:48:18.209] Bear[Script Filter] Script with argv '(null)' finished
[20:48:18.210] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:18.525] Bear[Script Filter] Queuing argument 'this '
[20:48:18.533] Bear[Script Filter] Script with argv '(null)' finished
[20:48:18.534] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:18.933] Bear[Script Filter] Queuing argument 'this i'
[20:48:18.941] Bear[Script Filter] Script with argv '(null)' finished
[20:48:18.942] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:19.121] Bear[Script Filter] Queuing argument 'this is'
[20:48:19.131] Bear[Script Filter] Script with argv '(null)' finished
[20:48:19.132] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:19.270] Bear[Script Filter] Queuing argument 'this is '
[20:48:19.283] Bear[Script Filter] Script with argv '(null)' finished
[20:48:19.284] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:19.489] Bear[Script Filter] Queuing argument 'this is a'
[20:48:19.498] Bear[Script Filter] Script with argv '(null)' finished
[20:48:19.499] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:19.631] Bear[Script Filter] Queuing argument 'this is a '
[20:48:19.638] Bear[Script Filter] Script with argv '(null)' finished
[20:48:19.639] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:19.822] Bear[Script Filter] Queuing argument 'this is a t'
[20:48:19.835] Bear[Script Filter] Script with argv '(null)' finished
[20:48:19.837] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:19.915] Bear[Script Filter] Queuing argument 'this is a te'
[20:48:19.925] Bear[Script Filter] Script with argv '(null)' finished
[20:48:19.926] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:19.944] Bear[Script Filter] Queuing argument 'this is a tes'
[20:48:19.949] Bear[Script Filter] Script with argv '(null)' finished
[20:48:19.949] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:20.222] Bear[Script Filter] Queuing argument 'this is a test'
[20:48:20.238] Bear[Script Filter] Script with argv '(null)' finished
[20:48:20.238] ERROR: Bear[Script Filter] Code 127: /bin/bash: cmd/create/create: No such file or directory
[20:48:32.207] Logging Started...

 

Edited by rob213
Link to comment
  • 1 month later...

This is a great workflow 🙏.

 

I use it all the time, but it fails sometimes, I think, because Alfred has been updated, which makes macOS want to de-authorise the workflow. 

 

The solution is given here [https://github.com/drgrib/alfred-bear#authorize-all-executables]. You use CLI to go to the workflow and run "xattr -rd com.apple.quarantine cmd" to authorise it again. Then searching works. 

 

It's a few steps so I thought that it would be worth streamlining. So far, I've just been selecting one of the shell lines, below, from a Bear note and using PopClip to run it in iTerm. It would probably be more convenient to run in Alfred (Shortcuts, Keyboard Maestro, etc)

 

Version 1

# This changes directory & runs the authorisation in one line. 
# If you want to use it, replace XXX with your Username. 
cd /Users/XXX/Library/CloudStorage/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.6FC9E059-46E3-4200-90F2-745362247D62 && xattr -rd com.apple.quarantine cmd

 

Version 2

# The problem is that if you have Macs with different User names (I do), the path will be wrong. 
# This version sets a variable to the current User account and replaces that bit of the path, so cd-ing should work anywhere. 
# If you want to use it, it should work as is. 
current_user=$(id -un) && cd "/Users/$current_user/Library/CloudStorage/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.6FC9E059-46E3-4200-90F2-745362247D62" && xattr -rd com.apple.quarantine cmd

 

Link to comment
  • 1 month later...

Does his work with Bear 2?

 

I just installed the workflow and followed the instructions on GitHub to make it work with the Apple Silicone chip. When I type "BS" Bear Search appears for a second and then reverts back to Google search

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...