Open FinbarArgus opened 1 year ago
Doesn't fix your issue but here is a more dynamic version that will move them to another directory
#!/bin/bash
find ../Supernote -name "*.note" -print0 | while read -d $'\0' file
do
newFile="${file/Supernote/Supernote_Converted}"
newFile="${newFile%.*}.pdf"
newDir="$(dirname "${newFile}")"
mkdir -p "${newDir}"
supernote-tool convert -t pdf -a "$file" "$newFile"
done
@FinbarArgus I've made some changes and are running through cron every 5 minutes https://gist.github.com/cwhittl/2e384fedc4aef449a87365d5a80340a2
I created a docker image which converts all files in the supernote directory to pdf (using rake
rather than make
, simply because I understand rake better).
https://adityam.github.io/linux-blog/post/converting-supernote-files-to-pdf/
Here is my version that is run as a .bat file on windows scheduler every night. It only converts files that have been edited in the last couple of days (or day). It creates a cloned file structure of \NOTE in \EXPORT but with converted pdf's. This only processes .note files not pdf.mark files. Just remove the ' at the beginning, before the > nul, and at the end
'@echo off
echo New Supernote files in the last day being converted then moved. Find this file To edit in j-AppData. set /A MINAGE=0, MAXAGE=1
set "MAXAGE=%MAXAGE:-=%" & set "MINAGE=%MINAGE:-=%" & set /A MAXINC=MAXAGE+1
'> nul forfiles /P \Dropbox\Supernote\Note /s /m .note /D -%MINAGE% /C "cmd /C if @isdir==FALSE 2> nul forfiles /M @file /D -%MAXINC% || > con cmd /c supernote-tool convert -t pdf -a @file @fname.pdf"
robocopy
The pause at the end is just so the window is up in the morning so that I know it ran.
@FinbarArgus I've made some changes and are running through cron every 5 minutes https://gist.github.com/cwhittl/2e384fedc4aef449a87365d5a80340a2
Thanks! This is super handy!
I'm hoping to post a new version this evening.. Done some cool things with it that I haven't had a time to share.
Actually here it is.. I was using obsidian and I used the folder structure in SuperNote to create Tasks and also check for it already being attached to a note or not https://gist.github.com/cwhittl/21869e95b26f5705f9409330c751e784
I'm not sure if there is a way to do this already.
This works in a bash file but would be nice if it could be done without a bash script
p.s. Super handy tool, thank you!