How can find text only in second column of cell?
Hi, everyone
I only want to find second column of dollar sign
aim to apply to character style: "Bold+Italic",
I can I make it happen?
screenshot:

I have this script, can someone help me to change it's function?
if ( app.selection.length > 0 && ( app.selection[0].constructor.name == "Cell" || app.selection[0].constructor.name == "Table" ) ) {
if ( app.scriptPreferences.version >= 6 ) {
app.doScript( main, ScriptLanguage.JAVASCRIPT , [], UndoModes.ENTIRE_SCRIPT, "style every second column in selection" );
}
else {
main();
}
} else {
alert ( "Nothing or wrong selection!" );
}
function main() {
var myColor = "PANTONE 252 U";
var myFillTint = 20;
var myCharStyleName = "Bold";
var curSel = app.selection[0];
var allCells = curSel.cells;
var startCol = curSel.cells[0].name.split(":")[0]*1;
var endCol = curSel.cells[-1].name.split(":")[0]*1;
var counter = startCol + 1;
for ( var i = 0 ; i < allCells.length; i++ ) {
var curCell = allCells;
var curCol = curCell.name.split(":")[0]*1;
if ( curCol == counter ) {
curCell.fillColor = myColor;
curCell.fillTint = 20;
curCell.texts[0].appliedCharacterStyle = myCharStyleName;
counter = counter + 2;
}
if ( counter > endCol ) {
counter = startCol + 1;
} // end if
} // end for
} // end main
John