Hi there!
Question: is the possibility of writing a plain text file to the system with the ECMAScript API for a custom CLI script?
Scenario: say I am writing a processing tool to perform a batch geometry operations on a set of files. I want to be able to save the modified file, which is straightforward through the documentInterface.exportFile() function. However, I want to generate an additional .log file with the same name, with a breakdown of the modifications on that file. How can that additional, plain text file be written to disk? Since it looks like the ECMAScript interface is not implemented with Node.js, none of its file system APIs are present...
Thanks a lot!
Export text file from ECMAScript routine
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
-
- Active Member
- Posts: 28
- Joined: Fri May 10, 2019 6:26 pm
Re: Export text file from ECMAScript routine
You can use the extensive Qt API. Have a look at:
https://github.com/qcad/qcad/blob/maste ... tExport.js
https://github.com/qcad/qcad/blob/maste ... tExport.js
-
- Active Member
- Posts: 28
- Joined: Fri May 10, 2019 6:26 pm
Re: Export text file from ECMAScript routine
Ooooh, I see... So the full Qt API has an ECMAScript mirror...? That is sooo interesting...
Wonderful, thank you Andrew!
Wonderful, thank you Andrew!