Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to turn on smart text reflow for all documents in a book?

Community Expert ,
Jan 19, 2016 Jan 19, 2016

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!

Screen Shot 2016-01-19 at 12.57.43 PM.png

TOPICS
Scripting
1.4K
Translate
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

Community Expert , Jan 20, 2016 Jan 20, 2016

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.

Translate
Advisor ,
Jan 19, 2016 Jan 19, 2016

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();

}

Translate
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
Community Expert ,
Jan 19, 2016 Jan 19, 2016

I'd also like to Uncheck "Limit to Primary Text Frames."

Translate
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
Community Expert ,
Jan 20, 2016 Jan 20, 2016

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.

Translate
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
Community Expert ,
Jan 20, 2016 Jan 20, 2016
LATEST

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!

Translate
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
Community Expert ,
Jan 19, 2016 Jan 19, 2016

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

Translate
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