Skip to main content
Inspiring
July 27, 2016
Answered

"Expected Unit" when assigning column width on InDesign Server 2015

  • July 27, 2016
  • 3 replies
  • 1024 views

I'm currently transferring my InDesign scripts to run on InDesign Server 2015, so far everything worked fine, until now.

When I try to assign a width to a column, I receive the following error:

Error String: Invalid value for set property 'width'. Expected Unit, but received "1.058mm".

The code looks like this (listTable is my table object and iEigCol a counter within a for loop, so nothing out of the ordinary):

var spacerColumnWidth = 1.058;

listTable.columns[iEigCol].width = spacerColumnWidth + 'mm';

A few lines earlier I'm using this:

listTable.columns[0].width = '82mm';

Which works just fine.

I already tried these approaches instead:

  • Using just the number without the unit
  • Using an integer instead of a double
  • Concatenating the string before using it to assign the width
  • Using a literal string

so far nothing worked here. Strange thing is, that it works on dozens of other columns with any of the mentioned ways to do it.

The exact same script also works fine in InDesign CS5.5.

Any ideas what the problem might be?

Thanks a lot!

This topic has been closed for replies.
Correct answer AriEss

InDesign does not let you define a table column width or row height under 1.058mm (even not in scripting). And in scripting, it does not let you define under 1.059mm. Try to work with 1.059mm, and it should work.

3 replies

tpk1982
Legend
July 28, 2016

try to define units first..

app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.MILLIMETERS; 

app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.MILLIMETERS; 

then no need to use 'mm', so the coding like

var spacerColumnWidth = 1.058

listTable.columns[iEigCol].width = spacerColumnWidth

listTable.columns[0].width = 82

also keep mind what AriEss said.. the values i am not sure

AriEss
AriEssCorrect answer
Inspiring
July 27, 2016

InDesign does not let you define a table column width or row height under 1.058mm (even not in scripting). And in scripting, it does not let you define under 1.059mm. Try to work with 1.059mm, and it should work.

Community Expert
July 28, 2016

AriEss wrote:

InDesign does not let you define a table column width or row height under 1.058mm (even not in scripting). And in scripting, it does not let you define under 1.059mm. Try to work with 1.059mm, and it should work.

At least on the height I can proof a height under 1.058 mm by scripting.

1. Set topInset and bottomInset of all cells in a row to value 0

2. Set the pointSize of texts[0] of every cell in a row to value 0.1 or less

3. Apply the height. E.g. "0.5 mm"

See this screenshot from InDesign CC v9.3.0 (also tested with CC 2014.2) where I selected and changed the height of the cells of the second row in the table to 0.5 mm:

However, doing the width of a column with less than 1.059 mm is not possible by scripting the DOM with CS6 and above. Editing IDML or editing IDMS and placing the table will result in widths less than 1.059 mm.

Regards,
Uwe

Inspiring
July 28, 2016

Laubender schrieb:

At least on the height I can proof a height under 1.058 mm by scripting.

Can confirm that, I used that to hide some dummy rows. I haven't checked though if they actually are that small, since they were not set to a visible color, but so far no one complained

Anyway, 1.059mm worked, so I'm using that, 0.001 additional millimeters won't do much harm.

Thanks a lot!

Community Expert
July 27, 2016

If I remember that right, a minimum value for table cell's width was "introduced" with (perhaps) CC 2014 as we always had it with the UI of InDesign but not with ExtendScript scripting.

Filed a bug report on this that was dismissed.

Not only InDesign Server is affected, also the desktop products.

Regards,
Uwe

Community Expert
July 28, 2016

Laubender wrote:

If I remember that right, a minimum value for table cell's width was "introduced" with (perhaps) CC 2014 as we always had it with the UI of InDesign but not with ExtendScript scripting.

I was wrong with CC 2014. It was CS6 v8.0.2 where that was changed.

See this thread and a possible workaround using an edited IDMS file of the table:

I need to force column widths to values smaller than the indesign preset minimuns (1,058mm).