Steal kerning from InDesign.py – NameError: name ‘kernValue’ is not defined


#1

hey there, i get this issue from the macro-panel …

Traceback (most recent call last):
File “Steal kerning from InDesign.py”, line 142, in
print " ERROR: Could not set kerning for %s-%s (%i)." % (leftSide, rightSide, kernValue)
NameError: name ‘kernValue’ is not defined

how can i solve this?
thanks!


#2

i managed to do some further test to track down the issue:

Start
Accessing: Adobe InDesign CC 2019
Extracting kerning from doc: boyle.indd
Found text: ’’a’’b’’c’’d’’e’’f’’g’’h’’i’’j’’k’’l’’m’’n’’o’’p’’q’’r’’s’’t…
Found font: FTBoyle Thin
Applying kerning to: FTBoyle, Master: Light

ERROR: Could not set kerning for s-i (-29).
ERROR: Could not set kerning for s-i (-29).
Kerning for a-quoteright set to -29.
ERROR: Could not set kerning for s-i (-29).
ERROR: Could not set kerning for s-i (-29).
Kerning for b-quoteright set to -35.
ERROR: Could not set kerning for s-i (-35).
ERROR: Could not set kerning for s-i (-35).
No kerning between c-quoteright. Ignored.
ERROR: Could not set kerning for s-i (0).
ERROR: Could not set kerning for s-i (0).
Kerning for d-quoteright set to 1.
ERROR: Could not set kerning for s-i (1).
ERROR: Could not set kerning for s-i (1).
Kerning for e-quoteright set to -14.
ERROR: Could not set kerning for s-i (-14).
ERROR: Could not set kerning for s-i (-14).
Kerning for f-quoteright set to 26.
ERROR: Could not set kerning for s-i (26).
ERROR: Could not set kerning for s-i (26).
Kerning for g-quoteright set to -2.
ERROR: Could not set kerning for s-i (-2).
ERROR: Could not set kerning for s-i (-2).
Kerning for h-quoteright set to -34.
ERROR: Could not set kerning for s-i (-34).
ERROR: Could not set kerning for s-i (-34).
Kerning for i-quoteright set to 3.
ERROR: Could not set kerning for s-i (3).
ERROR: Could not set kerning for s-i (3).
Kerning for j-quoteright set to -3.
ERROR: Could not set kerning for s-i (-3).
ERROR: Could not set kerning for s-i (-3).
Kerning for k-quoteright set to 31.
ERROR: Could not set kerning for s-i (31).
ERROR: Could not set kerning for s-i (31).
Kerning for l-quoteright set to -3.
ERROR: Could not set kerning for s-i (-3).
ERROR: Could not set kerning for s-i (-3).
Kerning for m-quoteright set to -20.
ERROR: Could not set kerning for s-i (-20).
ERROR: Could not set kerning for s-i (-20).
Kerning for n-quoteright set to -25.
ERROR: Could not set kerning for s-i (-25).
ERROR: Could not set kerning for s-i (-25).
Kerning for o-quoteright set to -23.
ERROR: Could not set kerning for s-i (-23).
ERROR: Could not set kerning for s-i (-23).
Kerning for p-quoteright set to -26.
ERROR: Could not set kerning for s-i (-26).
ERROR: Could not set kerning for s-i (-26).
Kerning for q-quoteright set to -21.
ERROR: Could not set kerning for s-i (-21).
ERROR: Could not set kerning for s-i (-21).
Kerning for r-quoteright set to 10.
ERROR: Could not set kerning for s-i (10).
ERROR: Could not set kerning for s-i (10).
Kerning for s-quoteright set to -13.
ERROR: Could not set kerning for s-i (-13).
ERROR: Could not set kerning for s-i (-13).
Kerning for t-quoteright set to 36.
ERROR: Could not set kerning for s-i (36).
ERROR: Could not set kerning for s-i (36).
Kerning for u-quoteright set to -21.
ERROR: Could not set kerning for s-i (-21).
ERROR: Could not set kerning for s-i (-21).
Kerning for v-quoteright set to 7.
ERROR: Could not set kerning for s-i (7).
ERROR: Could not set kerning for s-i (7).
Kerning for w-quoteright set to 7.
ERROR: Could not set kerning for s-i (7).
ERROR: Could not set kerning for s-i (7).
Kerning for x-quoteright set to 7.
ERROR: Could not set kerning for s-i (7).
ERROR: Could not set kerning for s-i (7).
Kerning for y-quoteright set to 8.
ERROR: Could not set kerning for s-i (8).
ERROR: Could not set kerning for s-i (8).
Kerning for z-quoteright set to 2.
ERROR: Could not set kerning for s-i (2).
ERROR: Could not set kerning for s-i (2).
Kerning for ae-quoteright set to -12.
ERROR: Could not set kerning for s-i (-12).
ERROR: Could not set kerning for s-i (-12).
Kerning for oe-quoteright set to -30.
ERROR: Could not set kerning for s-i (-30).
ERROR: Could not set kerning for s-i (-30).
End

this is only an issue with the string. if a i put a whitespace between the quotation it will just works fine.


#3

Is there a waterfall with si somewhere in your InDesign file?


#4

I think I fixed the cause of this problem.

The other one with the many s-i messages you can probably ignore.


#5

thank you!


#6

I tried it again and the script crashs if there are qoutes in the string:

Kerning for Tbar-Z set to -1.
Kerning for Z-H set to -8.
Kerning for H-quoteleft set to 30.
Traceback (most recent call last):
File “Steal kerning from InDesign.py”, line 142, in
print " ERROR: Could not set kerning for %s-%s (%i).\n" % (leftSide, rightSide)
TypeError: not enough arguments for format string
End


#7

‘a’ ’a‘ ‘b’ ’b‘ ‘c’ ’c‘ ‘d’ ’d‘ ‘e’ ’e‘ ‘f’ ’f‘ ‘g’ ’g‘ ‘h’ ’h‘ ‘i’ ’i‘ ‘j’ ’j‘ ‘k’ ’k‘ ‘l’ ’l‘ ‘m’ ’m‘ ‘n’ ’n‘ ‘o’ ’o‘ ‘p’ ’p‘ ‘q’ ’q‘ ‘r’ ’r‘ ‘s’ ’s‘ ‘t’ ’t‘ ‘u’ ’u‘ ‘v’ ’v‘ ‘w’ ’w‘ ‘x’ ’x‘ ‘y’ ’y‘ ‘z’ ’z‘ ‘æ’ ’æ‘ ‘œ’ ’œ‘ ‘þ’ ’þ
‘A’ ’A‘ ‘B’ ’B‘ ‘C’ ’C‘ ‘D’ ’D‘ ‘E’ ’E‘ ‘F’ ’F‘ ‘G’ ’G‘ ‘H’ ’H‘ ‘I’ ’I‘ ‘J’ ’J‘ ‘K’ ’K‘ ‘L’ ’L‘ ‘M’ ’M‘ ‘N’ ’N‘ ‘O’ ’O‘ ‘P’ ’P‘ ‘Q’ ’Q‘ ‘R’ ’R‘ ‘S’ ’S‘ ‘T’ ’T‘ ‘U’ ’U‘ ‘V’ ’V‘ ‘W’ ’W‘ ‘X’ ’X‘ ‘Y’ ’Y‘ ‘Z’ ’Z‘ ‘Æ’ ’Æ‘ ‘Ð’ ’Б ‘Œ’ ’Œ
‚a‚ ‚b‚ ‚c‚ ‚d‚ ‚e‚ ‚f‚ ‚g‚ ‚h‚ ‚i‚ ‚j‚ ‚k‚ ‚l‚ ‚m‚ ‚n‚ ‚o‚ ‚p‚ ‚q‚ ‚r‚ ‚s‚ ‚t‚ ‚u‚ ‚v‚ ‚w‚ ‚x‚ ‚y‚ ‚z‚ ‚æ‚ ‚œ‚ ‚þ
A‚A‚ ‚B‚ ‚C‚ ‚D‚ ‚E‚ ‚F‚ ‚G‚ ‚H‚ ‚I‚ ‚J‚ ‚K‚ ‚L‚ ‚M‚ ‚N‚ ‚O‚ ‚P‚ ‚Q‚ ‚R‚ ‚S‚ ‚T‚ ‚U‚ ‚V‚ ‚W‚ ‚X‚ ‚Y‚ ‚Z‚ ‚Æ‚ ‚Ђ ‚Œ

e.g


#8

OK, possible that it is not compatible with quotes. Perhaps they break the format string.