How to select or copy all text in InDesign document

New Here ,
Dec 31, 2020 Dec 31, 2020

Copy link to clipboard

Copied

I want to select all text content of every page in an InDesign document or copying all text in InDesign document. I have tried scripting method, but did not work.

TOPICS
Scripting

Views

93

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Dec 31, 2020 Dec 31, 2020

Copy link to clipboard

Copied

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Dec 31, 2020 Dec 31, 2020

Copy link to clipboard

Copied

In addition to Derek's suggestion you might want to look at https://redokun.com/blog/indesign-to-word to see how to use a pdf exported from InDesign to Acrobat and then from there directly to a Word Document.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 31, 2020 Dec 31, 2020

Copy link to clipboard

Copied

Hello Karky5EA7,

 

The below script will write all the text from a InDesign document to a single .txt file, saving the .txt file to the same location as the Indesign document.

 

 

doc = app.documents[0];

var fileName = doc.name.replace(/.indd$/i, "");

var path = doc.filePath;

var myTextFilename = fileName + '_TEXT.txt';

allStorys = [];
var allStoriesArray = app.documents[0].stories.everyItem().getElements();
for(var n=0; n<allStoriesArray.length; n++){
allStorys.push(allStoriesArray[n].contents);
}

var myText = allStorys;

var file = new File(path +'/' + myTextFilename);

file.encoding = 'UTF-8';
file.open('w');
file.write(myText);
file.close();
alert('Done writing the text!')

 

 

 

Regards,

Mike

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines