Copy link to clipboard
Copied
I have hundreds of documents for which I need to turn on Smart Text Reflow. Is there a way, via a script, that I can activate this setting automatically, so I don't have to do it to every single document manually?
Ideally, I could run the script for each book file and be done with it.
Many thanks!

Add these to either of the scripts:
doc.textPreferences.addPages = AddPageOptions.END_OF_STORY;
doc.textPreferences.limitToMasterTextFrames = true;
doc.textPreferences.preserveFacingPageSpreads = false;
doc.textPreferences.deleteEmptyPages = false;
doc for Vamitul's script, docs for my version.
Copy link to clipboard
Copied
http://www.indesignjs.de/extendscriptAPI/indesign8/#TextPreference.html
the script is something like (assumes you have a indb already opened):
var bk=app.activeBook;
var doc;
for (var i=0; i<bk.bookContents.length; i++){
doc=app.open(bk.bookContents.fullName,false);
doc.textPreferences.smartTextReflow=true;
doc.save();
doc.close();
}
Copy link to clipboard
Copied
I'd also like to Uncheck "Limit to Primary Text Frames."
Copy link to clipboard
Copied
Add these to either of the scripts:
doc.textPreferences.addPages = AddPageOptions.END_OF_STORY;
doc.textPreferences.limitToMasterTextFrames = true;
doc.textPreferences.preserveFacingPageSpreads = false;
doc.textPreferences.deleteEmptyPages = false;
doc for Vamitul's script, docs for my version.
Copy link to clipboard
Copied
Perfect! I used Vamitul's script, and then added Peter's addition at the bottom. (But I changed the seance line to "false").
Thank you both for you assistance!
Copy link to clipboard
Copied
This should do it. Open all your book files, run this script, then save and close the book files:
(function(){
var docs = app.documents.everyItem().getElements();
for (var i = 0; i < docs.length; i++) {
docs.textPreferences.smartTextReflow = true;
}
}());
Peter
Find more inspiration, events, and resources on the new Adobe Community
Explore Now