Highlighted

Workaround enabling Multiple Flowing Threads in One Document

Community Beginner ,
May 26, 2020

Copy link to clipboard

Copied

Hi All!
We all know Indesign only allows one auto thread on master pages per document . If you tried to have 2 or more flowing text frames then InDesign will disregard the current flow of the document and will create as many new spreads as needed to complete the second thread. And while this is happening the first thread will also not be not be connected. It's hard to describe but a few members on here have asked about it as well. Here's what it looks like:

On the left is a normal autoflow scenerio. On the right is what happens if you try to have a second thread autoflow. Notice that a new spread is created.

farhann57200552_0-1590529714296.png

 

 

This has been a problem for me with some of my projects. To solve this, it occured to me that if text frames can be given a object style and then InDesign can be told to thread those text frames by object styles then in effect we can have unlimited threads per document.

Personally I don't know programming or scripting so I sought help on this. With the help of Jongware and Brianp311 the following script was created which finds the text frames and then stiches them together based on the Object Style Name. 

In effect you can now have multiple (unlimited?) threads workingin the documents.

 

Usage:

1. Apply object styles to text frames on Master pages

2. Override pages where threading is to happen.

3. Run Script and choose desired object style

 

At present the script will display a list of Object Names currently in the document allowing the user to pick the one they want to thread. If new pages are added mid document, the script can be run again and it will thread the new pages properly. I would like to improve the script and hopefully some users can help.

Current Improvements Wishlist:

1. Programmatically override objects from master page before threading. 

2. Dropdown menu for list of object styles.

3. Fix script crash when an object is present on the pasteboard.

After years of learning tips and tricks from the online community, I hope this small contribution helps!

 

 

 

 

var sortFrames = function (arr) {
    arr.sort(function (a, b) {
        if (a.parentPage.documentOffset < b.parentPage.documentOffset) {
            return -1;
        }
        else if (a.parentPage.documentOffset > b.parentPage.documentOffset) {
            return 1;
        }
        else {
            if (a.geometricBounds[0] < b.geometricBounds[0]) {
                return -1;
            }
            else if (a.geometricBounds[0] > b.geometricBounds[0]) {
                return 1;
            }
            else {
                if (a.geometricBounds[1] < b.geometricBounds[1]) {
                    return -1;
                }
                else if (a.geometricBounds[1] > b.geometricBounds[1]) {
                    return 1;
                }
                return 0;
            }
        }
    });

};

var combineMe = new Array;
var Find_objectStyles = app.documents[0].objectStyles.everyItem().name;  
var preset_list = ("", undefined, Find_objectStyles); 
app.findObjectPreferences = null;
app.findObjectPreferences.appliedObjectStyles = prompt ("Object Styles List:", preset_list, "Select Object Style");

found_list = app.activeDocument.findObject();
for (a=0; a<found_list.length; a++) {
    if (found_list[a] instanceof TextFrame) {
        combineMe.push(found_list[a]);
    }
}


main();
function main(){
    //Make sure a document is open.
	if (app.documents.length != 0){	
		sortFrames(combineMe);			
	}
	else{
		alert ("Please open a document.");
	}
}


sortFrames(combineMe);

for (var c = 0; c < combineMe.length - 1; c++) {
    try {
        combineMe[c+1].previousTextFrame = null;
        combineMe[c].nextTextFrame = combineMe[c + 1];
    } catch(e) {}
}

 

 

 

 

 

 

Topics

Bug, How to, Scripting

Views

320

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

Workaround enabling Multiple Flowing Threads in One Document

Community Beginner ,
May 26, 2020

Copy link to clipboard

Copied

Hi All!
We all know Indesign only allows one auto thread on master pages per document . If you tried to have 2 or more flowing text frames then InDesign will disregard the current flow of the document and will create as many new spreads as needed to complete the second thread. And while this is happening the first thread will also not be not be connected. It's hard to describe but a few members on here have asked about it as well. Here's what it looks like:

On the left is a normal autoflow scenerio. On the right is what happens if you try to have a second thread autoflow. Notice that a new spread is created.

farhann57200552_0-1590529714296.png

 

 

This has been a problem for me with some of my projects. To solve this, it occured to me that if text frames can be given a object style and then InDesign can be told to thread those text frames by object styles then in effect we can have unlimited threads per document.

Personally I don't know programming or scripting so I sought help on this. With the help of Jongware and Brianp311 the following script was created which finds the text frames and then stiches them together based on the Object Style Name. 

In effect you can now have multiple (unlimited?) threads workingin the documents.

 

Usage:

1. Apply object styles to text frames on Master pages

2. Override pages where threading is to happen.

3. Run Script and choose desired object style

 

At present the script will display a list of Object Names currently in the document allowing the user to pick the one they want to thread. If new pages are added mid document, the script can be run again and it will thread the new pages properly. I would like to improve the script and hopefully some users can help.

Current Improvements Wishlist:

1. Programmatically override objects from master page before threading. 

2. Dropdown menu for list of object styles.

3. Fix script crash when an object is present on the pasteboard.

After years of learning tips and tricks from the online community, I hope this small contribution helps!

 

 

 

 

var sortFrames = function (arr) {
    arr.sort(function (a, b) {
        if (a.parentPage.documentOffset < b.parentPage.documentOffset) {
            return -1;
        }
        else if (a.parentPage.documentOffset > b.parentPage.documentOffset) {
            return 1;
        }
        else {
            if (a.geometricBounds[0] < b.geometricBounds[0]) {
                return -1;
            }
            else if (a.geometricBounds[0] > b.geometricBounds[0]) {
                return 1;
            }
            else {
                if (a.geometricBounds[1] < b.geometricBounds[1]) {
                    return -1;
                }
                else if (a.geometricBounds[1] > b.geometricBounds[1]) {
                    return 1;
                }
                return 0;
            }
        }
    });

};

var combineMe = new Array;
var Find_objectStyles = app.documents[0].objectStyles.everyItem().name;  
var preset_list = ("", undefined, Find_objectStyles); 
app.findObjectPreferences = null;
app.findObjectPreferences.appliedObjectStyles = prompt ("Object Styles List:", preset_list, "Select Object Style");

found_list = app.activeDocument.findObject();
for (a=0; a<found_list.length; a++) {
    if (found_list[a] instanceof TextFrame) {
        combineMe.push(found_list[a]);
    }
}


main();
function main(){
    //Make sure a document is open.
	if (app.documents.length != 0){	
		sortFrames(combineMe);			
	}
	else{
		alert ("Please open a document.");
	}
}


sortFrames(combineMe);

for (var c = 0; c < combineMe.length - 1; c++) {
    try {
        combineMe[c+1].previousTextFrame = null;
        combineMe[c].nextTextFrame = combineMe[c + 1];
    } catch(e) {}
}

 

 

 

 

 

 

Topics

Bug, How to, Scripting

Views

321

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
May 26, 2020 0
Adobe Community Professional ,
May 28, 2020

Copy link to clipboard

Copied

Hi farhann,

I would test all the available options and combinations for autoflow.

Preferences > Type > Smart Text Reflow

 

Option "Limit To Primary Text Frames" should be turned off.

 

Regards,
Uwe Laubender

( ACP )

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
Reply
Loading...
May 28, 2020 0