Trying to Export All Document Stories to RTF via Scripting

Enthusiast ,
Dec 25, 2021 Dec 25, 2021

Copy link to clipboard

Copied

Hi Experts,

Im trying to export all document stories to RTF File, it shouid be simple task but the following script only export one story not all the stories, can you please help to identify the problem? and thanks a lot in advance :

 

 

var myDoc = app.activeDocument
var mystories = myDoc.stories.everyItem();
var nfolder1 = "~/Desktop";
var fName = "myFile";
var nFile=new File("~/Desktop/myFile.rtf");
mystories.exportFile(ExportFormat.RTF, nFile);
alert("Exporting Document to RTF Done!");
if (nFile.exists) 
nFile.execute(); 

 

 

 

Best
M.Hasanain
TOPICS
Scripting

Views

190

Likes

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

correct answers 1 Correct answer

Guru , Dec 25, 2021 Dec 25, 2021

Check out the 'ExportAllStories.jsx' in the \Scripts Panel\Samples\JavaScript folder:

KasyanServetsky_0-1640466790359.png

It makes a separate text file for each story.

Here's a script that puts them on a page-by-page basis into a single file. It was made for CS3 but still works in 2022.

Hope it helps!

— Kas

Likes

Translate

Translate
Adobe Community Professional ,
Dec 25, 2021 Dec 25, 2021

Copy link to clipboard

Copied

Likes

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 25, 2021 Dec 25, 2021

Copy link to clipboard

Copied

Thanks a lot @Derek Cross but i just want to do it by script

Best
M.Hasanain

Likes

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 25, 2021 Dec 25, 2021

Copy link to clipboard

Copied

Click the link that Derek posted and you'll see this statement:

"TextExporter 4 can export all the stories of an InDesign document into a single file."

It is a script.

Likes

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 25, 2021 Dec 25, 2021

Copy link to clipboard

Copied

@Peter Kahrel  Thanks a lot

Best
M.Hasanain

Likes

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 25, 2021 Dec 25, 2021

Copy link to clipboard

Copied

@Peter Kahrel  But Version 4 is Extension!/Plugin , and with this way i will not be able to continue my script developing, unlucky this is not what i was seeking for!, please advice me?

Best
M.Hasanain

Likes

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
Guru ,
Dec 25, 2021 Dec 25, 2021

Copy link to clipboard

Copied

Check out the 'ExportAllStories.jsx' in the \Scripts Panel\Samples\JavaScript folder:

KasyanServetsky_0-1640466790359.png

It makes a separate text file for each story.

Here's a script that puts them on a page-by-page basis into a single file. It was made for CS3 but still works in 2022.

Hope it helps!

— Kas

Likes

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 25, 2021 Dec 25, 2021

Copy link to clipboard

Copied

LATEST

@Kasyan Servetsky 

Thanks a lot, yes thats help a lot

 

Best
M.Hasanain

Likes

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