Hello,
I am trying to write a script that looks at the content of the last column of a table and based on what it finds applies formatting to the first column, for every row of the table.
For example, in each row if the last column has a 6 digit number that starts with "4" I want the first column to apply one of my swatches. If the number starts with a "3" I want it to apply a different swatch.
I tried using the regular expression object since I'm fairly comfortable with GREP syntax but I keep getting errors. I just don't know how to use the object correctly or if this is even the right approach.
Here is the code:
if (myTable.rows.item().everyItem().cells.item(-1).contents == RegExp((4)+\d+))
{myTable.rows.item().everyItem().cells.item(0).fillColor = myDocument.swatches.item("Blue");}
I am brand new to scripting so very open to any help.
Thanks!
Lindsay