-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to Convert ... because specified file doesn't exists #167
Comments
This is strange. Seems like the error is either with What do you get when you execute the command line directly (identical to the above pandoc.exe -f docx -t markdown_mmd-simple_tables-multiline_tables-grid_tables+pipe_tables+task_lists-mmd_link_attributes-raw_html -i c:\notes\Reprise\docx\{76279337-9B48-0B09-34AF-30DA87D5B196}{1}{E185189248259008087511978443734194607593311}-1662474788.docx -o c:\notes\Reprise\Nouvelle-section-1\6-9-2022---Expert-comptable.md --wrap=none --markdown-headings=atx --extract-media=C:/Users/MDRICG~1/AppData/Local/Temp/Reprise/2023-08-02-18-16-42-0695980 versus something like if you simplified pandoc.exe -f docx -t markdown_mmd-simple_tables-multiline_tables-grid_tables+pipe_tables+task_lists-mmd_link_attributes-raw_html -i c:\notes\Reprise\docx\{76279337-9B48-0B09-34AF-30DA87D5B196}{1}{E185189248259008087511978443734194607593311}-1662474788.docx -o c:\notes\Reprise\Nouvelle-section-1\6-9-2022---Expert-comptable.md --wrap=none --markdown-headings=atx --extract-media=C:/notes if there's no error on the second one, then the error might have something to do with |
Looking at this again, alternatively the problem might be with The full path of your home directory is I'm not that experienced with Windows to know why and when it uses the shortened home directory name sometimes (E.g. |
Little bit of reading, the problem is with the value of Hints:
Let me open a PR to fix this. |
…ortened path for Windows users with long usernames Previously, the value of `$env:TEMP` is, for a Windows user with a long username, something like `C:\users\somelo~1` for an actual path like `C:\users\somelongusername`. This value causes problems with `pandoc` which does not recognize shortened paths. Now, the full path of `$env:TEMP` is resolved. This should fix the script for users with long usernames (anything more than 8 characters). Useful links: - https://superuser.com/questions/529400/how-does-progra1-path-notation-work - https://web.archive.org/web/20131206010029/http://support.microsoft.com/kb/142982 - https://superuser.com/questions/348079/how-can-i-find-the-short-path-of-a-windows-directory-file - https://superuser.com/questions/1524767/powershell-uses-the-short-8-3-form-for-envtemp Fixes #167
Could you try #168 and let me know if it works? |
…ortened path for Windows users with long usernames Previously, the value of `$env:TEMP` is, for a Windows user with a long username, something like `C:\users\somelo~1` for an actual path like `C:\users\somelongusername`. This value causes problems with `pandoc` which does not recognize shortened paths. Now, the full path of `$env:TEMP` is resolved. This should fix the script for users with long usernames (anything more than 8 characters). Useful links: - https://superuser.com/questions/529400/how-does-progra1-path-notation-work - https://web.archive.org/web/20131206010029/http://support.microsoft.com/kb/142982 - https://superuser.com/questions/348079/how-can-i-find-the-short-path-of-a-windows-directory-file - https://superuser.com/questions/1524767/powershell-uses-the-short-8-3-form-for-envtemp Fixes #167
I tried #168 with new conversion script but same error, so i go back to your direct tests with pandoc.exe
It generates a good and full converted .md file from .docx source I finally found what was wrong: It cames from PATH Environment that was not correctly set for pandoc.exe !! You can easily change it looking for environment in start menu
@leojonathanoh I also retried previous versions of your script - 7cc35a8 "https://github.com/theohbrothers/ConvertOneNote2MarkDown/blob/docs/ci-cleanup-bug-report-issue-template/ConvertOneNote2MarkDown-v2.ps1" Sorry to make you search, it was in my environment |
Thank you for your research. It's odd that the script didn't actually validate that |
It does seem like pandoc To verify this on my machine, installed pandoc using the Let me add the solution to improve on the docs. Thanks again 😄 |
…hortened path Previously, the value of `$env:TEMP` is an MSDOS 8.3 shortened path. For example, the home directory of a Windows user with a long username (E.g. `somelongusername`) is shortened to `C:\users\somelo~1` instead of `C:\users\somelongusername`. Now, the full path of `$env:TEMP` is used. This improves readability and understandability. Useful links: - https://superuser.com/questions/529400/how-does-progra1-path-notation-work - https://web.archive.org/web/20131206010029/http://support.microsoft.com/kb/142982 - https://superuser.com/questions/348079/how-can-i-find-the-short-path-of-a-windows-directory-file - https://superuser.com/questions/1524767/powershell-uses-the-short-8-3-form-for-envtemp Related #167
Super Job 👌 |
oh yes, list tags. I think it's part of the xml object of the page, but this script does not convert them to markdown front matter or references in markdown. hope you manage to get it working 😃 |
this is cool stuff, didn't know you could do such things with onetastic. Perhaps this may be added in the readme for people who want to use such an approach for preserving tags etc 😄 |
Bug
Failed to convert page: Nouvelle-section-1\6-9-2022---Expert-comptable. Exception: Error while converting docx file c:\notes\Reprise\docx{76279337-9B48-0B09-34AF-30DA87D5B196}{1}{E185189248259008087511978443734194607593311}-1662474788.docx to markdown file c:\notes\Reprise\Nouvelle-section-1\6-9-2022---Expert-comptable.md. Exception: Impossible d’exécuter cette commande en raison de l’erreur : Le fichier spécifié est introuvable.
Convert-OneNotePage : Failed to convert page: Nouvelle-section-1\6-9-2022---Expert-comptable. Exception: Error while converting docx file
c:\notes\Reprise\docx{76279337-9B48-0B09-34AF-30DA87D5B196}{1}{E185189248259008087511978443734194607593311}-1662474788.docx to markdown file
c:\notes\Reprise\Nouvelle-section-1\6-9-2022---Expert-comptable.md. Exception: Impossible d’exécuter cette commande en raison de l’erreur: Le fichier spécifié est introuvable.
Au caractère C:\Users\MédéricGUERIN\Downloads\ConvertOneNote2MarkDown-master\ConvertOneNote2MarkDown-master\ConvertOneNote2MarkDown-v2.ps1:1422 : 257
Expectation
Conversion from .docx to .md stop because script didn't find docx file even though it exists
Discussion
It is strange because conversion from OneNote to docx works. Docx file is exactly what it should.
The file is correctly named , and the missing file in the error message exists!
It seems to have no length error, no directory error.
The only thing is that i d'ont use VS environnement because I have no other use and it would be heavy for my computer. I run script directly from an admin powershell console. The log file talks about PIA Assembly: could it be the error source? How can i check and correct if it's missing (without installing VS environment :) )?
Environment
-- Start of Logfile --
-- End of Log File ---
Output of
$PSVersionTable
The text was updated successfully, but these errors were encountered: