Issues with my Things 3 Parser

Originally posted this in the Automators forum. Maybe with a few more eyes here, someone could help me figure out the issues. I hope, once it works that other people will find it useful as well!

I’m not sure if this is the right place to ask for help with this kind of thing but I figured since this forum is about automation it would be ok. I’m attempting to make a Python version of Peter Davidson-Reiber’s Things Parser for Drafts. I don’t have Drafts but love the idea of making templates and quick input using natural language in another app. It’s coming along well but I’ve run into 2 issues I can’t figure out.

  1. For some reason, the last line in a block overrides the information in the other lines of a block.

  2. Things does not accept the JSON as valid for some reason.

I plan to have it work on Pythonista and adding a Automator service and application.
That way you could right click on a file and add it to Things or you could click and drag a file to the application and it would add to Things.

P.S. Found out clicking and dragging a note from Bear to the desktop or Finder will auto-export it as a *.txt file there!

Here’s the repo.