Trouble with ThoughtsAsylum actions and Bear

Good morning all!
I recently downloaded the ThoughtAsylum suite of action groups for Draft. I was mostly interested in building some workflows between Drafts and Bear.

I have all the groups installed and ran the TAD-Setup/Refresh action as instructed.

When I try to run the “TAD-Export Draft to Bear,” however I get the following error. This happens on both MacOS and iOS.

Script Error: TypeError: undefined is not an object (evaluating ‘p_draftExport.title’)
Line number: 11185, Column 38

I also tried the TAD-Copy Bear Tags script and got:

Script Error: ReferenceError: Can’t find variable: genUUID
Line number: 10692, Column 19

I might have missed an installation step but I can’t figure out what it might have been. Any suggestions would be much appreciated.

Thanks!
Sergej

I’ll take a look this evening (UK time). See if I can reproduce and figure out what’s going on. Might be some typos I missed during testing. Bear functions have been out a while and no other reports to date, but maybe they’re not being heavily used?

Much appreciated Stephen! I heard you on the Automators podcast recently and it got me moving on exploring more sophisticated uses for Drafts.

Glad you got something from my appearance on The Automators podcast; now let’s see if we can get these issues resolved.

I have reproduced both issues and I think I have resolved them. I think they’re both down to some of the order in which I set stuff up in and how I must have tested that first one, but both definitely my mistakes.

I’ve pushed some updates to the Drafts directory and to the TADpoLe site that I believe should resolve them.

genUUID Error

I’m a little confused how this got past me. That’s the name of a function I use in TextExpander, not the name I use for the equivalent function in Drafts. I’ve updated that for the Bear function that uses it in the TADpoLe library. If auto updates are on, and you have the latest (i.e. released a few minutes ago), that should automatically trigger the download of the library, but you can always run TAD-Setup/Refresh to force a refresh regardless.

The function that had the error is one that all of the Bear functionality eventually uses as it is related to how the API token for Bear is stored. Therefore this update would be required before using any of the Bear functions so that your API token gets stored properly (as described in this post)

TAD-Export Draft to Bear

Once the above fix is applied, this one should be fixed in the latest version of the ThoughtAsylum - Export/Import/Share action group.

The action has been updated to pass in draft to the final line in the script - tb.TA_exportDraftToBear(draft); This should have been in there to tell the function what draft to export, i.e. the current one. Nice simple fix and obviously something I typed in rather than copying from my test file - I’ll try and be more careful next time :wink:


Hopefully together, these updates will resolve the issues, but do let me know if they don’t resolve them for you, or if you encounter any further issues.


Success! Thank you very much for both the speedy fix AND taking the time to explain what you fixed and why. The actions are working perfectly now and I’ve learned a few things.

Regards,
Sergej

No problem, and glad it worked. Thank you for flagging them up with enough detail for me to quickly track them down and fix them.