Copy link to clipboard
Copied
Hi every one
Can you make a script for applied second column of text applied to to character style ITALIC
Like this:
Thanks
John
Select the table and run the below script:
app.selection[0].columns[1].select();
app.selection[0].texts.everyItem().appliedCharacterStyle = "ITALIC"
Vandy
Copy link to clipboard
Copied
Try this,
for (s=0; s<app.activeDocument.stories.length; s++)
{
for (t=0; t<app.activeDocument.stories
.tables.length; t++){
app.activeDocument.stories
.tables.columns[1].select(); app.selection[0].texts.everyItem().appliedCharacterStyle = "ITALIC"
}
}
Vandy
Copy link to clipboard
Copied
THANK YOU VANDY
Thank you so much
John
Copy link to clipboard
Copied
Hi, Vandy
why this script function in all the table?
I only want it function in my selected table
Regard
John
Copy link to clipboard
Copied
Select the table and run the below script:
app.selection[0].columns[1].select();
app.selection[0].texts.everyItem().appliedCharacterStyle = "ITALIC"
Vandy
Copy link to clipboard
Copied
Hi Vandy
got an error
John
Copy link to clipboard
Copied
Working fine at my end.
Select the entire table and run the script...
What error ? screenshot pls....
Vandy
Copy link to clipboard
Copied
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';
}
Copy link to clipboard
Copied
Thank you Kai Rübsamen
thank you so much
Copy link to clipboard
Copied
sorry I don't select entire table
John
Find more inspiration, events, and resources on the new Adobe Community
Explore Now