Skip to main content
Known Participant
April 29, 2022
Question

Break links to style

  • April 29, 2022
  • 3 replies
  • 2294 views

Is there a way to break links to style on multiple pages at a time? I have to move pages from other documents into a document and I don't want to bring the styles in with it. 

3 replies

Participating Frequently
December 12, 2023

In fact there is unfortunately no command like "...breakLinkToStyle(...)" or so. What you need to do is the following in order to break the link from ... :
table to table style:

table.appliedTableStyle = app.activeDocument.tablesStyles[0];
table.clearTableStyleOverrides();

cell to cell style: analogous, replacing "table" by "cell";

object to object style: analogous, replacing "table" by "object";

paragraph from paragraph style:

text..applyParagraphStyle(app.activeDocument.paragraphStyles[0], false);

character from character style:  analoguous, replacing "Paragraph" by "Character".

Not kind of straighforward, but anyway, it works.

Participating Frequently
December 12, 2023

Sorry, obviously only one period character in

text.applyParagraphStyle(.....);

rob day
Community Expert
Community Expert
April 30, 2022

Hi @Veronica22551996i6fw , I don’t think there is a break link to style command in the scripting API, but you can select all the paragraphs and invoke the menu item via scripting, so you can try this:

 

 

var doc = app.activeDocument
var bls =  app.menuActions.itemByID(8500)

for(var i=0; i < doc.stories.length; i++){  
    var s = doc.stories.item(i);  
    for(var j=0; j < s.paragraphs.length; j++){  
        var p=s.paragraphs[j]; 
        p.select()
        if(bls.enabled){  
            bls.invoke();  
        }; 
    }  
} 

 

Participating Frequently
December 8, 2023

You are the life saviour! I've been lookind for this for literally years.

Since just assigning a key combination to this option gives ugly results.

Diane Burns
Inspiring
April 29, 2022

If the text is threaded, of course, you can Select All and choose Break Links from the Para Styles menu. If the frames are not threaded, I think you'll have to select each frame. You can select multiple text frames and Break Links on all of them at once, provided they are not threaded to another page/spread. 

The only other thing I can think of is to search out whether there's a script to automate further.

Robert at ID-Tasker
Legend
December 12, 2023

It's about Char/Para Styles - not links between TextFrames.

 

Participating Frequently
December 12, 2023

I see that Diane understood well what it was about, and gave correct instructions to break the links of ALL paragraphs to their respective styles in one or in multiple threaded text frames. Inasmuch, she exactly answered the question.