mangini/gdocs2md

Put converted text in a dialogue box instead of emailing (enhancement)

JDLH opened this issue · 1 comments

JDLH commented

I appreciate this script's ability to convert a Docs document to Markdown. It came in very handy.

However, I didn't want the script to email the converted document. The contents of my document were somewhat confidential. I was happier keeping it off the insecure public email system and away from possible eavesdroppers. I preferred to have the script pop up a dialogue box with the converted Markdown text, allowing me to copy the text and paste it into a text editor for further manipulation.

I commented out Lines 71-77, which generate an email message with the converted text attached, and put in the following calls:

  var ui = HtmlService.createHtmlOutput("<pre>"+text+"</pre>")
  DocumentApp.getUi().showModelessDialog(ui,"Markdown");

This worked fine for my one document one time. It would nice to have this integrated into this script somehow. It would probably be better to offer the option of emailing or putting up a dialogue box, instead of hard-coding one or the other. I don't want to take the time right now to design that, so I am not offering a Pull Request. Maybe this request will encourage someone else to do that work.

JDLH commented

I wrote a blog post How to convert Google Docs to Markdown format (30. April 2019) explaining this script, and the changes which put converted text in a dialogue box. That might give more background about this enhancement request.