Link in Zwischenablage kopieren
Kopiert
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
Link in Zwischenablage kopieren
Kopiert
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
Link in Zwischenablage kopieren
Kopiert
THANK YOU VANDY
Thank you so much
John
Link in Zwischenablage kopieren
Kopiert
Hi, Vandy
why this script function in all the table?
I only want it function in my selected table
Regard
John
Link in Zwischenablage kopieren
Kopiert
Select the table and run the below script:
app.selection[0].columns[1].select();
app.selection[0].texts.everyItem().appliedCharacterStyle = "ITALIC"
Vandy
Link in Zwischenablage kopieren
Kopiert
Hi Vandy
got an error
John
Link in Zwischenablage kopieren
Kopiert
Working fine at my end.
Select the entire table and run the script...
What error ? screenshot pls....
Vandy
Link in Zwischenablage kopieren
Kopiert
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';
}
Link in Zwischenablage kopieren
Kopiert
Thank you Kai Rübsamen
thank you so much
Link in Zwischenablage kopieren
Kopiert
sorry I don't select entire table
John
Weitere Inspirationen, Events und Ressourcen finden Sie in der neuen Adobe Community
Jetzt ansehen