Bear & Todoist action

Is there a way to sent a drafts note to bear (create a new note) and add tags, based on what is set in Drafts. And then receive the link to the note in Bear and create a Todoist task with it.

Hope for some support

In my code library for Drafts, there is a class called TadBear, for working with bear. It just uses the standard Bear x-callback URLs. In that, the creation of a new Bear note from drafts returns the unique identifier for the new Bear note. This is the key parameter in the Bear URL for opening the note, so you could build that URL from the return of the creation.

Note Creation:

URL Creation:

https://bear.app/faq/X-callback-url%20Scheme%20documentation/#open-note

Hope that’s enough to get you started.

Thanks, I have installed these and can see them in Drafts. But When I create a new action and do a request (e.g. to TadBear) I receive an error it is not recognized

Can share your action and the error message?

My best guess at this point would be that you may not have set everything up to be used correctly. Something related to the following perhaps?

  • Is the tad.js library installed in the correct location?
  • Have you installed it via the ThoughtAsylum Action Group, or manually?
  • How have you loaded/included the library in your action?

Thanks,

I have ru the INSTALL on every page for the different action groups. They are shown up in DRAFTS. But From there I do no really know what to do. I tried several way;
frist used the example given in the TadBear section, installed it as a script, but that run into errors TadBear could not be found.
The I though I need to do action request, so I used action as type and name another Action just installed. All with erros as result.

It should be my bad, but do not understand how to use these action groups in combination with my personal need

I have built an example action for you that I think does the sorts of things you are talking about.

Create a new Bear note from current draft.
Include draft tags as Bear tags.
Build a URL to open the new Bear note from the result passed back from Bear.
Put the URL into a new draft, load the new draft and switch to link mode so you can click on the link to open the note.

See if it works, and gives you the starting point that you need.

If you get an error, please post the exact details.

If you create your own action and have an issue, please post a link to it so we can check for what might be causing the issue.

thanks, unfortunately I run into the same error as I had

Script Error: Error: The file “tad.js” couldn’t be opened because there is no such file.
Line number: 20, Column 75

Run the TAD-Setup/Refresh action again(?)

That’s narrowed it down to your initial setup having an issue as my action definitely includes the library; and works in my testing.

Try this version:

It does not rely on external libraries, and demonstrates how Drafts captures the callback results from Bear, which include the new note’s identifier, as template tags for subsequent actions to use.

for me it’s abacadabra, how could I run that action (TAD-Setup/Refresh)?

I found the action within the operation and run that by clicking it in the menu. It shows several notification, all successful. Unfortunately, the other actions failed for the same reason

however, this script seems to run. At least it shows no error :slight_smile:
it creates the BEAR note, but in Todoist it creates a TASK with the title of the not and not the link to the note.

It is in the ThoughtAsylum Action Group and forces a refresh of the library - the tad.js file that gets downloaded to your Drafts Library/Scripts folder.

There is something very strange going on in that case. The successful messages are various library files, including tad.js, being copied down to your device. This should happen automatically.

I wonder if you have deleted some directories you shouldn’t have? Can you create /Library/Scripts/ in your iCloud Drive Drafts folder and repeat?

The link should appear as a comment on the task created in Todoist:

I see, the comment section is not something I use. I expected it in the notes or in the task desscription itself. But thanks, it seems it is working.

You could easily change that in the last step of the action,
Just replace the [[title]] in the todoist action step by [[[title]]]([[bearLink]]) and it should show the link directly in the task