2Do Integration Script

I’ve tried just setting a simple reminder on a note. Whether DT is open or minimised I’ve never got an alert.

A screenshot would be useful. And did you enable reminder alarms in Preferences > General?

For myself, these are reminders, repeating daily or weekly, launching an applescript.
Yes, Devonthink is running - this is a Mac Mini, running constantly
An example is a script creating my daily journal note created each morning at 7am

A screenshot of Preferences > General and of the reminder would be useful. E.g. I’m using successfully a daily reminder which executes a script.

Nice!!

I use a smart rule, CLI for Todoist, and the script from this thread to add items to Todoist when I tag them with .Todoist --but I’m really liking @BLUEFROG’s script from this thread…

Hi @BLUEFROG, I’m having another look at the ToDoist script. I’m still getting the same error and it’s indicating the enclosed line?

I have a feeling I’m being dense :wink: I don’t have to install the ToDoist CLI or anything do I?

Screen Recording 2021-07-19 at 16.05.38.mov.zip (5.1 MB)

No CLI in needed. It’s using their URL scheme.

PS: In 98% of cases, I don’t offer or suggest things with external dependencies. I believe in working with what’s available out-of-the-box as much as possible.

What’s the error being reported?

@BLUEFROG thanks for the reply. I’ve included a screen recording above - there is no error… It pops up to say when is it due, I select one then nothing.

Alternatively, I currently use a smart search with #ToDo tags etc is there any way to return the text on the line within the search? e.g. “#ToDo Something that needs doing” - currently it just returns the title of the associated document?

Open the script in Script Editor.
Select a file in DEVONthink and run the script in Script Editor.

@BLUEFROG I’ve tried that again and I get the enclosed error. I’ve also enclosed a screen recording so you can see what’s happening. Interestingly if I run todoist://addtask?content=mytask&date=tomorrow&priority=4 in Safari it works as expected? It looks like something in the syntax? I appreciate your help.

Screenshot 2021-07-20 at 07.36.06

Screen Recording 2021-07-20 at 07.34.00.mov.zip (6.4 MB)

Are you in Big Sur? It seems that zsh has problems with open URL that bash (the shell before Big Sur) does not have.

Yes. Ahh that would explain it then :slight_smile: It’s been driving me a bit nuts :wink: Is there any way round it?

This seems to reference it, but I can’t work out how to amend the code correctly?

I’ll have to retract my previous statement, it seems that ZSH is not the culprit here. The URL is (@bluefrog).

"Tomorrow" is apparently not a valid date (at least not on my Mac running in German. But then, even "morgen" is not accepted). 2021-07-21 is valid, for example. Also, according to the documentation, priority has to be something between 1 and 4, not “false”.

This works here, and yes, it has been used as an example in the Todoist documentation.
'todoist:/addtask?content=Test&date=tomorrow'
So, no double quotes for the date.

As a side note: All this has nothing to do with DT. To debug, one can simply use the terminal window and the open command. Then, if the URL command is set up correctly, replace it in the script’s “do shell” call.

It doesn’t. That thread refers to a problem with angular brackets, which are not used in your case.

@chrillek Ok, thank you for your time looking into it.

@chrillek I hope I am not pushing your good will, but I cannot for the life of me see how to amend the following correctly. I have tried many different combinations…

do shell script “open 'todoist://addtask?content=” & (my percentencode(my cleanname(recTitle))) & “&date=”" & theChoice & “”&priority=" & recState & “’”

I keep getting unknown token?

Please include code blocks in backticks like so:
```
Code goes here
```
Otherwise it is impossible to see what’s happening.
Also, you’re still passing “false” as “priority” if the record’s state is false. That will not work. I have no idea what “mypercentcode” or “theChoice” might be. In fact, I’d suggest to start with something simple like

do shell script "open 'todoist://addtask?content="Test"&date=tomorrow`"

If that works, you can go for the more complicated things. And: “More complicated” probably means URL escaping spaces and other special characters, so that requires more work. Since I don’t know the whole script, those might already be taken care of, but I do not know.