I need to export InDesign file as text (textType). There are several examples of this but I couldn't found the script which export InDesign file as text in active Indesign document path with indesign file name.
For Example: If file is MyDoc.indd, export text file name should be MyDoc.txt.
If anybody have this code, please provide me.
This is not entirely straightforward because InDesign exports stories, not documents, to text. So you need to collect the contents of all stories, figure out what order they should be (that's the hard part), combine them, and then export to text. See www.rorohiko.com for an example.
>What is the js code for exports stories with active InDesign file name in designated folder?
You realise that your second story "with the active InDesign file name" would overwrite your first story with that same file name?
Talking around in circles, aren't we? See anwser #1 above!
But, suit yourself. This does what you are asking:
app.activeDocument.stories.exportFile(ExportFormat.TEXT_TYPE, new File(app.activeDocument.fullName.fullName.replace(/\.indd$/i,'')+".txt"));
Europe, Middle East and Africa