SjoerdV / ConvertOneNote2MarkDown

Ready to make the step to Markdown and saying farewell to your OneNote, EverNote or whatever proprietary note taking tool you are using? Nothing beats clear text, right? Read on!
GNU General Public License v3.0
196 stars 113 forks source link

More conversion errors #22

Closed myfta closed 2 years ago

myfta commented 2 years ago

I'm running the script as Admin in Powershell ISE also Onenote as Admin (version 16.0.14430.20270).

First few notes seem to convert OK but with warnings:

pandoc.exe : [WARNING] Deprecated: --atx-headers. Use --markdown-headings=atx instead.
At C:\Users\G\Downloads\1convert\master\ConvertOneNote2MarkDown.ps1:132 char:17
+ ...             pandoc.exe -f docx -t gfm -i $fullexportpath -o "$($fulle ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ([WARNING] Depre...gs=atx instead.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Then the trouble really starts, all the following notes go something like this:

Error while publishing file 'Note Title' to docx: Exception calling "Publish" with "4" argument(s): "The remote p
rocedure call failed. (Exception from HRESULT: 0x800706BE)"
pandoc.exe : [WARNING] Deprecated: --atx-headers. Use --markdown-headings=atx instead.
At C:\Users\G\Downloads\1convert\master\ConvertOneNote2MarkDown.ps1:132 char:17
+ ...             pandoc.exe -f docx -t gfm -i $fullexportpath -o "$($fulle ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ([WARNING] Depre...gs=atx instead.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

couldn't unpack docx container: not enough bytes
Exception calling "GetPageContent" with "3" argument(s): "The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)"
At C:\Users\G\Downloads\1convert\master\ConvertOneNote2MarkDown.ps1:141 char:15
+               $OneNote.GetPageContent($pageid, [ref]$pagexml, 7)
+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : COMException

Get-Content : Cannot find path 'C:\Users\G\Downloads\1convert\structure\FH\FH\Note Title.md' because it does 
not exist.
At C:\Users\G\Downloads\1convert\master\ConvertOneNote2MarkDown.ps1:192 char:19
+ ...           ((Get-Content -LiteralPath "$($fullexportpathwithoutextensi ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\G\Down...Note Title.md:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Error while renaming image file path references for file 'Note Title': You cannot call a method on a null-valued 
expression.

Suggestions please ...

SjoerdV commented 2 years ago

@myfta the pandoc warning should be fixed with updated syntax merged from #17. If the Word file is empty this could result in the error you are seeing. Could you try again please as there also was an update handling the docx filenames as mentioned in #23

myfta commented 2 years ago

I hope I was able to point you in the right direction for other users, but I have changed pc and not re-installed OneNote. Thanks.