chrisbro / alfred-bear Goto Github PK
View Code? Open in Web Editor NEWAlfred 3 workflow to create and search notes in Bear.
Alfred 3 workflow to create and search notes in Bear.
When searching for a title, it's obvious in the title of the note the reason that note was pulled up. Not so much for results found via text - it only shows the title of the note, so it's hard to tell the content that matched.
Show the content that matched in the results so that users can better see which note to open.
Thank you so much for making this fantastic workflow!
Is it possible to fetch the notes content by holding down a modifier key in the search bar? Something similar to the way one can paste the link to note to the frontmost app, but instead past the note contents?
I have been attempting to do this, but my knowledge of Golang is non existent, so it hasn't worked.
I'm getting a workflow incompatible issue when using this new release with Alfred 3.8.2 [963] which appears to be the latest Alfred v3 release.
Each time I try to search for a note or tag, I get the following error:
no such table: ZSFNOTE
I am running the release version of alfred-bear and version 1.3.1 of bear on macOS 10.13.1
Just for reference:
After downloading your workflow, which I found helpful and well-designed, I went to work adding a few additional features that I had grown accustomed to in the Evernote Workflow:
bls
command to "list" the most recent bear notes without having to remember their titles and search for thembs
in its own window without opening the main windowbn
note
However, I noticed that you have a PR that is still open from Nov 7, 2017 and don't want to spend time setting up my own PR if this project isn't in active development.
Neat little workflow. Any chance you can add search through content or is that a problem performance-wise?
"bs" crashes with the error shown below. I am on Monterey with Apple silicon.
[08:03:24.480] Bear[Script Filter] Queuing argument 'f'
[08:03:24.605] Bear[Script Filter] Script with argv '(null)' finished
[08:03:24.607] ERROR: Bear[Script Filter] Code 1: 08:03:24 workflow.py:2225 DEBUG Workflow version : 0.3.5
08:03:24 workflow.py:1628 DEBUG Reading settings from /Users/lawrence/Library/Application Support/Alfred/Workflow Data/com.chrisbro.bear/settings.json
...
08:03:24 workflow.py:2514 DEBUG Update check not due
08:03:24 workflow.py:1859 DEBUG Loading cached data from : /Users/lawrence/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.chrisbro.bear/__workflow_update_status.cpickle
08:03:24 workflow.py:2444 DEBUG update_data : {u'available': False}
08:03:24 search.py:37 DEBUG Started search workflow
08:03:24 search.py:60 DEBUG [u'f']
08:03:24 search.py:42 DEBUG Searching notes for f
08:03:24 search.py:98 DEBUG Searching notes
08:03:24 workflow.py:1748 DEBUG Data db_path
stored in cpickle
format
08:03:24 workflow.py:1763 DEBUG Stored data loaded from : /Users/lawrence/Library/Application Support/Alfred/Workflow Data/com.chrisbro.bear/db_path.cpickle
08:03:24 queries.py:202 DEBUG /Users/lawrenceporter/Library/Group Containers/9K33E3U3T4.net.shinyfrog.bear/Application Data/database.sqlite
08:03:24 workflow.py:2243 ERROR unable to open database file
Traceback (most recent call last):
File "/Users/lawrence/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.FFB1C5EB-498D-49F8-8531-B644F70975C5/workflow/workflow.py", line 2236, in run
func(self)
File "search.py", line 43, in main
execute_search_query(args)
File "search.py", line 99, in execute_search_query
title_results = queries.search_notes_by_title(WORKFLOW, LOGGER, query)
File "/Users/lawrence/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.FFB1C5EB-498D-49F8-8531-B644F70975C5/queries.py", line 138, in search_notes_by_title
return run_query(workflow, log, sql_query)
File "/Users/lawrence/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.FFB1C5EB-498D-49F8-8531-B644F70975C5/queries.py", line 204, in run_query
conn = sqlite3.connect(db_path)
OperationalError: unable to open database file
08:03:24 workflow.py:2267 DEBUG Workflow finished in 0.017 seconds.
[08:03:24.610] Bear[Script Filter]
<title>Error in workflow 'com.chrisbro.bear'</title>unable to open database file/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns
Hey, I usually inspect workflows before using, and noticed a few oddities:
alfred-bear.alfredworkflow
contains .pyc
files which is compiled byte code, there's no benefit to this as it increases the sizeNotify.tgz
file, which contains Notify.app
, and then there's a bunch of python code that seems unused?Thought I'd make you aware, cheers.
My regex-fu is not quite strong enough to make this easy. Need to figure out how best to support multi-word tags without screwing everything up.
I'm not a python developer or particularly knowledgable about SQLite extensions, however, I've been trying to figure out how to make fuzzy search possible with this workflow.. my current understanding is that I'd need to:
database.sqlite
TAGS_BY_TITLE
query so that it does a MATCH
query on the FTS3 virtual table?I'm guessing the above steps would likely break a few things, and it's maybe not so straightforward. @chrisbro do you have any thoughts on this?
Apparently they not only changed the location but also the structure of the DB.
In my database, it is:
sqlite> .schema Z_6TAGS
CREATE TABLE Z_6TAGS ( Z_6NOTES INTEGER, Z_13TAGS INTEGER, PRIMARY KEY (Z_6NOTES, Z_13TAGS) );
CREATE INDEX Z_6TAGS_Z_13TAGS_INDEX ON Z_6TAGS (Z_13TAGS, Z_6NOTES);
In the queries you are using table Z_5TAGS with fields Z_5NOTES, Z_10TAGS.
I don't get why they would increment (version?) field names (???) but sadly, this happened.
For me the following did the trick (fixed the search)
$ sed -i '' -e 's/Z_5/Z_6/g' -e 's/Z_10/Z_13/g' queries.py
Thanks for your awesome work!
I need to search something besides English words. Could you please add other languages support?
Also, when doing bst
search by tag, it just displays the tag name. Could you please add the note title on the list?
First of all, thanks for this, it's working perfectly.
I'm wondering if it's possible to disable the behaviour that after creating a note, bear opens.
Is it possible to do this in the background?
I am getting this error on all calls. I can see that the ZSFNOTE table exists in the database:
"~/Library/Group Containers/9K33E3U3T4.net.shinyfrog.bear/Application Data/database.sqlite."
I'm willing to write a patch, but I couldn't figure out how to do it :)
Specifically referring to new_window
parameter to /open-note
using bst the a tag with space would appear on the dropdown. When chosen would bear becomes active but does not switch to the tag.
e.g. "bst #tag/with space" will not work (here there is a tag #tag/with space#
I'd like to be able to append text (or bullet points?) to a note. Ideas:
If you enter "bn whatever" just have it write 'whatever' to the title only, not the text of the note too.
Search results is empty when I'm trying to search by more then two keywords.
But when I put these keywords into Bear search bar I can find a note:
Debug info:
0:12:28 search.py:37 DEBUG Started search workflow
00:12:28 search.py:60 DEBUG [u'git revert']
00:12:28 search.py:42 DEBUG Searching notes for git revert
00:12:28 search.py:98 DEBUG Searching notes
00:12:28 workflow.py:1748 DEBUG Data `db_path` stored in `cpickle` format
00:12:28 workflow.py:1763 DEBUG Stored data loaded from : /Users/mac/Library/Application Support/Alfred 3/Workflow Data/com.chrisbro.bear/db_path.cpickle
00:12:28 queries.py:123 DEBUG /Users/mac/Library/Containers/net.shinyfrog.bear/Data/Documents/Application Data/database.sqlite
00:12:28 queries.py:127 DEBUG SELECT DISTINCT ZUNIQUEIDENTIFIER, ZTITLE FROM ZSFNOTE WHERE ZARCHIVED=0 AND ZTRASHED=0 AND lower(ZTITLE) LIKE lower('%git revert%')ORDER BY ZMODIFICATIONDATE DESC
00:12:28 queries.py:130 DEBUG Found 0 results
Question: is it possible to improve a search?
Suggested by "td." on the Alfred Forum.
When creating a new note, if the user types "#" to start entering a tag, show tag suggestions and ideally allow them to arrow down and tab on entries to auto-complete the tag name.
Hi, this is a hugely useful Alfred plug-in for me. I'm wondering if it would be possible for Bear to open with the cursor in the actual note so I can start typing as soon as it opens after calling open a Note with the bs alfred workflow?
Thanks,
Jacob
I just upgraded to the latest version of MacOS and unfortunately it broke these wonderful workflows. It appears that /usr/bin/python
has been removed. Executing a command gives the following error:
[14:30:43.717] ERROR: Bear[Script Filter] Code 127: /bin/bash: /usr/bin/python: No such file or directory
/usr/bin/python3
does exist, but pointing the Bear commands directly to that version still produces an error:
ModuleNotFoundError: No module named 'cPickle'
Any one else run into this? Any ideas on how to resolve? Thanks in advance.
Suggested by "td." on the Alfred Forum.
Once a new note is created using "bn": focus the editor so that you can immediately begin typing. Maybe possible with Automator?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.