Hi:
I’m trying to detect whether the last paragraph, or the penultimate paragraph, in a text frame contains a thin space. The Applescript dictionary has nothing in it for “constant”, “thin space” or “enumeration” so I’m trying to understand how to work with this kind of character.
I have something sort of working, but I was wondering what the best technique is for CC. This doesn’t work:
tell application id "com.adobe.indesign"
set thinSpace to thin space
tell document 1
tell page 1
set lastPara to a reference to paragraph -1 of text frame "column2"
if (contents of lastPara) contains thinSpace then
set theAnswer to "Yes"
else
set theAnswer to "No"
end if
return theAnswer --> returns No, which is wrong
end tell
end tell
end tell
However, if I know the position of the thin space, this works:
if (character -2 of (contents of lastPara)) contains thinSpace then
Which doesn’t make sense to me right now – do “contain” and/or “is in” not work with these types of characters in certain situations? Is there a way to get them to work?
Can anyone explain how to work with characters like thin space? Like maybe how to test for unicode numbers or something similar?
Thanks in advance for any insights, pointers to documentation, or some examples! -k
Browser: Safari 605.1.15
Operating System: macOS 10.14