Skip to main content
Lordrhavin
Inspiring
June 15, 2026

In design: swatch expected, but swatch gotten ?!

  • June 15, 2026
  • 3 replies
  • 51 views

The following code on a tables cell…

    cell.leftEdgeStrokeColor = app.swatches[0];
cell.rightEdgeStrokeColor = app.swatches[0];

 

translation “Swatch expected, but swatch gotten”

Results in this error. Thats probably not a helpful error message.
Oh, and BTW, the Bugreport “Category Listing” does not have InDesign, so i had to chose something else...

3 replies

rob day
Community Expert
Community Expert
June 15, 2026

Hi ​@Lordrhavin , I assume the cell you are referencing is in the active document? Try setting the left edge stroke color in the the active document’s first swatch, not the application’s first swatch:

 

//all the active document’s tables
var t = app.activeDocument.stories.everyItem().tables.everyItem().getElements()
//the first cell of the doc’s first table
var c = t[0].cells[0]

//set the left edge stroke color to the active document’s first swatch
c.leftEdgeStrokeColor = app.activeDocument.swatches[0];

$.writeln(t[0].cells[0].leftEdgeStrokeColor.name)
//returns "None"

 

John T Smith
Community Expert
Community Expert
June 15, 2026

This is the USING THE COMMUNITY forum... this is where the forum is discussed
This is not where you ask program or account questions
Moving a message to the correct forum is not working
Start here https://community.adobe.com/community to find the correct forum for your question

Lordrhavin
Inspiring
June 15, 2026

What part of “the Bugreport “Category Listing” does not have InDesign, so i had to chose something else...” was unclear?

Joel Cherney
Community Expert
Community Expert
June 15, 2026

It is clear that you believe that snide remarks will get you somewhere. In that spirit, let me explain to you how to report a bug. Some Adobe apps have a bug report category here in the "Community"; other apps do not. InDesign bugs are tracked over at indesign.uservoice.com. Accordingly, you choose the wrong place to post. Instead of choosing the general InDesign forum, where your post would be welcomed, and discussed (and almost certainly referred to the Uservoice), you apparently posted in the "Using the Community"  forum, which is exclusively devoted to discussions regarding this Adobe Community. 

 

Helpful people have tried to move your post to a forum where you could get help, as it looks from you post like you could use some  assistance with Extendscript for InDesign!  But, if you do not want any assistance (with InDesign, or with the Community), and only wish to report a bug, the Uservoice is thataway.  

kglad
Community Expert
Community Expert
June 15, 2026

post this in the id forum, https://community.adobe.com/indesign-669

 

and change your title slightly to avoid a duplicate post error.

Lordrhavin
Inspiring
June 15, 2026

What part of “the Bugreport “Category Listing” does not have InDesign, so i had to chose something else...” was unclear?

leo.r
Community Expert
Community Expert
June 16, 2026

What part of “the Bugreport “Category Listing” does not have InDesign, so i had to chose something else...” was unclear?

 

After seeing similar reports, I’ve just specifically attempted to post in the InDesign forum. I think the UX for posting a question has changed (for the worse). I now understand what you were referring to when talking about the “Category Listing”. I can totally understand that after going through this process users can be sufficiently frustrated by the time the question is posted. Frankly, I think that many users simply give up before they’re able to post anything.