Glad to hear that @death.au. So far the script has been working well for me but I think moving it into a plugin when the API becomes available would be better.

2 Likes

This is fantastic… hopefully one of the Mac people will right something similar as this is exactly what I am looking for, so I can send via eMail to OmniFocus. #Bravo

At the moment I am using [[Todo]] for open ToDo’s in my notes, and change them to [[Done]] when completed. I just need to figure out how to have them listed in the note and not just inn the backlinks section.

1 Like

I am looking at https://imdone.io/ the big advantage it focus on the same markdown file.

4 Likes

I might be able to do something like this with Hazel on macOS.

1 Like

The trigger could be - [ ] by default.

3 Likes

great idea, thanks for sharing

Did you succeed?

I would be quite interested in some Obsidian Hazel magic.

1 Like

Is there a similar solution for Mac users?

Can it send tasks to Todoist as well?

1 Like

Yes, it is possible to send tasks to any email address you specify.

1 Like

Yeah, i know abou this feature of Todoist, but do you mean I can do it directly from Obsidian?

Yes, check the instructions in the link in the first post. The script will email the task you tag in Obsidian do any email-address (including your Todoist-email).

Hey @Sailesh did you manage to use imdone nicely with obsidian? it looks great

Any Mac versions out there for this? If written in task paper format it should fill in all the details in, for example, Omnifocus, right? That would be awesome !

3 Likes

Thank you!! It is very inspiring. Using Task Warrior, with your approach, would require a simple task add ... . Some bash-fu should be sufficient.

Scheduling the event could also take advantage of existing os integrations with the file system - see https://github.com/emcrisostomo/fswatch or https://github.com/gorakhargosh/watchdog or https://github.com/inotify-tools/inotify-tools/wiki.

Below I paste a starting point for the actual (bash) script, converting #tw tagged lines within any Obsidian note into a proper Task Warrior event…

Yet, it remains to be seen how to launch (automatically) this script. It depends on the OS and its tricks to “notify upon file change” in a folder (see above the links I have shared).

On macOs (Big Sur) fswatch works well (home-brew) by invoking:
fswatch -o $HOME/Dropbox/notes | xargs -n1 -I{} myScript.sh
(see also the latency flag of fswatch)

Below the myScript.sh:

#!/usr/bin/env bash

#

# Path containing the md files to monitor..
myPath=$HOME/Dropbox/notes

# String to trigger the Task Warrior "add" command
trigger="#tw"

# String to replace the original trigger
trigrpl="#ok_tw"

# Remove these strings when creating the TW new task descr
extra1="- "
extra2="\[ ] "
extra3="\[x] "


# Use grep recursively, on all files (and subfolders)
# in $myPath, while ignoring binary files.
entries=$(grep -r -I "$trigger" $myPath/*)

# Use sed to remove any occurrence of $trigger & #extra1,2,3
clean=$(echo "$entries" | sed "s@$trigger@@g" | sed "s@$extra1@@g" | sed "s@$extra2@@g" | sed "s@$extra3@@g")

# Scan every line present in the output of grep
IFS='
'

for entry in $clean
do
  # Use this bash expansion trick to remove all chars
  # preceding the first ":" (see grep output format)
  # That would be the "line" used to create a new task
  if task add ${entry#*:} ; then
    #echo "Command succeeded"
    sed -i '' "s@$trigger@$trigrpl@g" "${entry%:*}"  
    # Only if TW succeeds, replace $trigger with $trigrpl
  fi
done

I’ve mashed code into this that makes it export to todo.txt, however I’ve run into a bug to fix before I publish. I’ve created an issue on github.
It would be nice to turn this into a proper plugin though

2 Likes

Is there a similar solution for Mac. I would love to send tasks to Things 3.

1 Like

Any updates on this? I’ve been tinkering with todo.txt and see a lot of possibilities for it to work with Obsidian

It sort of works? It’s still a bit janky if you get it to do too many items at once (need to see if this is still true in base script), and it sometimes mucks up newlines, this can be fixed in script or through a PStodotxt patch potentially. I’ve been busy with a lot of other stuff recently. I’m possibly going to do a bit of a rewrite soon to see if I can address these issues. If anyone is better than powershell than me I can chuck it up on github for you to look at.