I want to create a directory with my notes from Evernote in files with the Markdown format. I found out that this can be made using Geeknote, but for each notebook every time.
How to create a bash script that synchronizes a directory, where each subdirectory is a different notebook, and inside these the markdown files?
While you make suggestions, I will keep this question updated.
Some background commands to start from
The command to two-way sync using Geeknote is the following:
gnsync --path ~/Evernote/Ler --logpath ~/.log/geeknote.log --format markdown --notebook ".Ler" --two-way TWO_WAY
The command to list my notebooks is:
@RichardAnderson suggested the following code to list and loop into the Evernote notebooks, I tested in my system and it is working. The problem is that the geeknote notebook-list command waits for user action during the listing, I also couldn't find a way to circumvent that.
Just create a file with the following content:
#!/bin/bash geeknote notebook-list > /tmp/list.txt Note_List=$(cat /tmp/list.txt | grep -v Total | cut -d : -f 2) for i in $Note_List; do gnsync --path ~/evernote --logpath ~/.log/geeknote.log --format markdownn --notebook "$i" --two-way TWO_WAY done
Don't forget to change to your path.
ATTENTION! If you have images or heavily formatted notes in your evernote account, please note that this method can potentially remove formatting and data within notes. So use at your own risk!
How to solve the last bit?
If you know a way of circumventing the need for user action during the geeknote note-list command, please drop a line below.