I wrote an AppleScript to convert DOCX or PPTX to TXT using qlmanage -p | textutil
Using QuickLook to turn anything to HTML:
http://hints.macworld.com/article.php?story=2010071209045151...
Using textutil to convert HTML to TXT:
https://stackoverflow.com/a/32621215
AppleScript source code: https://pastebin.com/JRbXTv8d