Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 114192

Re: Re: How can I let second column applied to character style “ITALIC”

$
0
0

John, I got an error is no description!

 

Vandys lines work here too. But I think, this isn’t really flexible and it is always a good idea to avoid the select-function.

I would do it in this way. The script assumes, that either the insertionPoint is in a cell, one or more cells are selected or the whole table.

 

var myTable = getTable();
formatTable( myTable );

// check selection
function getTable() {
    if( app.selection.length > 0 ) {        mySel = app.selection[0];          if( mySel.parent.constructor.name == 'Table' )        return mySel.parent;          else if( mySel.parent.parent.constructor.name == 'Table' )        return mySel.parent.parent;        else if ( mySel.constructor.name == 'Table' )        return mySel;    }    alert( 'Error!\rWrong selection or nothing selected.' );    exit();
}

// some styling
function formatTable( tbl ) {
    tbl.columns[1].cells.everyItem().texts[0].appliedCharacterStyle = 'italic';
}

Viewing all articles
Browse latest Browse all 114192

Trending Articles



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