Unable to import my notes back to Joplin

Just had a try of that script.

I noticed that for it to work you need to import a couple of modules (import os, json) and modify some indents.

Also (unless I have broken your script somehow):

  1. Any JSON files that were actually Joplin metadata (tags, notebook names, records of attached files) are lost as they get turned into notes,
  2. You have to attach any resources again. They are all in the previously exported resources folder but do not get imported (because of item 1?),
  3. On some notes extra carriage returns are generated which can break up tables,
  4. The note title is also now the first line of any imported note even it it wasn’t originally (very minor point).

I am not a Python programmer so I must ask you if I have missed out any important stage / module? This is just so that I can try to learn a bit more about Python from what you have done…

BUT REGARDLESS

If anyone was ever in such a fix as yourself, it would save a huge amount of typing just to get all the note text back. Pretty impressive for just a few lines of Python!!

Yes, you are correct about import part. I didn't copied them.

Any JSON files that were actually Joplin metadata (tags, notebook names, records of attached files) are lost as they get turned into notes,

Yes they were lost. I was only aiming for Titles and Body.

you have to attach any resources again. They are all in the previously exported resources folder but do not get imported (because of item 2?),

There were very few resources so I decided not to spend time on them.

On some notes extra carriage returns are generated which can break up tables,

If you are talking about the except part. I did it handle to some non JSON files in directory. I never used tables in Joplin. But now I know about them so I will try.

The note title is also now the first line of any imported note even it it wasn’t originally (very minor point).

Yes, this is something that I wouldn't do if I have to do this again.

I am not a Python programmer so I must ask you if I have missed out any important stage / module? This is just so that I can try to learn a bit more about Python from what you have done…

Same here. I tried to understand the syntax of the script shared by betternote and updated with the help of google. No extra module. I was running out of time so python impressed me too.

1 Like

Thanks for the update. I am even more impressed that as a non-Python user you were able to take the original script and, with just a bit of Googling, turn it into something that got your notes back. Seeing you do this has encouraged me to finally try to learn more about Python. It seems too useful to ignore.

:+1:

2 Likes