I’ve been trying to set up a running append note in bear for each day using Drafts the same as the one I have running with Evernote. This was easy with even more because of the way Drafts integrates Evernote. Could we have the same integration for Bear?
Unfortunately I don’t believe that type of interaction is possible as Bear doesn’t have an API that is accessible by third party devs like Evernote does.
Thanks for that. I wasn’t aware it was api based. I have to tried to set it up using the bear url scheme before and technically it is possible but the append using a variable in the title doesn’t seem to work.
I just finished up an posted a Bear integration guide which links to a couple of example actions, including one that demonstrates appending to a monthly journal. Hopefully this is some help.
Josh is right that Bear does not have a web API to integrate with like Evernote, but you can accomplish most of the same things with their URL schemes.
I tried it and it worked as designed and it wouldn’t be hard to change to a day journal but it doesn’t do the bit I’ve struggled with the url scheme which is to time stamp each entry so I end up with one note each day containing time stamped entries.
As shared yours just includes each entry workout ant indication of when each entry was made.
It can be a little more tricky to configure in a URL because of the encoding requirements, but the same template tags as any template in Drafts are applicable.
In the case of the bear example you mention, you would need to change the text=[[draft]] parameter so it also contains the timestamp…likely something like: text=[[time]]%0A[[draft]]. This would add the time value, and a line feed. The “%0A” is a URL encoded line feed.
You can also make sure a string is URL encoded using {{ }} in a Drafts template.
To tweak that, check on other available tags in the template docs.
You might be interested by the script API I wrote for Bear: Bear script API.
The code to do what I understood you want is pretty simple:
var title = "Journal for " + draft.createdAt.toLocaleDateString();
var text = draft.content + "\n_" + draft.createdAt.toLocaleString() + "_";
Bear.appendTo(title, "section", text);