Skip to main content
Known Participant
May 7, 2009
Question

Change Stroke Color on a Row in a Table

  • May 7, 2009
  • 1 reply
  • 2085 views

Greetings,

I am trying to set the stroke color of a row to the swatch in my palette named "[None]".  My script runs and, interestingly enough, does not error...but it also does not change the stroke either.  Here is my script:

tell application "Adobe InDesign CS3"

set properties of row 1 of table 1 of page item "Box" of document 1 to {stroke color:"[None]"}

end tell

So in theory, when this script is done, my row should appear to have no black outlined cells.  What am I missing or otherwise doing wrong here?  Thanks in advance for the help!

This topic has been closed for replies.

1 reply

May 7, 2009

Hi wreyfmonkey,

It's a matter of context. The stroke color "[None]" can belong to either the application (where it's an application default) or the document. You want the one that belongs to the document. So...

set properties of row 1 of table 1 of page item "Box" of document 1 to {stroke color:"[None]" of document 1}

Thanks,

Ole

Known Participant
May 8, 2009

Hi Olav,

Much thanks for the reply!  The syntax you sent wouldn't compile, but I moved the squiggly bracket after the swatch name (like this: {stroke color:"[None]"} of document 1) and it did compile.  But for whatever reason, the stroke is still not changing and the script still does not error.  So after your help, I have the following script, but it still doesn't change the stroke...

tell application "Adobe InDesign CS3"

set properties of row 1 of table 1 of page item "Box" of document 1 to {stroke color:"[None]"} of document 1

end tell

Any other ideas?  I know this discussion can be "answered" with just a little help!

May 8, 2009

Hi wreyfmonkey,

Sorry about that, I typed the response off the top of my head and didn't test it. There are more problems with your script than just the first one I saw. Try something like this:

tell application "Adobe InDesign CS4"

     tell document 1

          set mySwatch to swatch 1

          set myTextFrame to item 1 of text frame "Box"

          set myTable to table 1 of text 1 of myTextFrame

          set top edge stroke color of row 1 of myTable to mySwatch

     end tell

end tell

Thanks,

Ole