Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: How to break link to cell/table style in a selection

$
0
0

For cell Selection is work (but can't keep the style setting after break the link), but I also want to break the table style, but error

For both Break link to cell/table style, I want to keep the style setting after break the link

 

BreakLinkToTableStyleSelection();
BreakLinkToCellStyleSelection();

function BreakLinkToTableStyleSelection () {

var
     mNone = app.activeDocument.tableStyles.item(0),
     mSel = app.selection[0];

if(mSel.constructor.name === "Cell" || mSel.constructor.name === "Table") {

    mSel.tables.everyItem().appliedTableStyle = mNone;

    return;
    };

if(mSel.hasOwnProperty("baselineShift")){
   
    mSel.tables.everyItem().appliedTableStyle = mNone;

    return;
    };

};



function BreakLinkToCellStyleSelection () {

var
     mNone = app.activeDocument.cellStyles.item(0),
     mSel = app.selection[0];

if(mSel.constructor.name === "Cell" || mSel.constructor.name === "Table") {

    mSel.cells.everyItem().appliedCellStyle = mNone;

    return;
    };

if(mSel.hasOwnProperty("baselineShift")){
   
    mSel.tables.everyItem().cells.everyItem().appliedCellStyle = mNone;

    return;
    };

};


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>