This content has been marked as final. Show 3 replies
Please forgive my inexperience with terminology. New PROPERTY is what I meant, not OBJECT. The script works perfectly right now by setting the strikeThru property to "true" for the selected characters and then changing it back to "false" at the end of the script, but I would still love to have a custom boolean property to set that would not be affected by any slight chance of a property that might actually be desired.
Your current approach is the only feasible one. You can't create new properties for Indesign's objects. In some cases it's easy: text frames, for instance, can have their label set to a certain value, as can several other objects (cells, the application, etc.).
But characters don't have the label property, so you have to use an existing property, as you did with overstrike. If you don't like using that particular one, have a look through the OMV under "Character" and see if there's a property that suits your needs better than overstrike.
What you can use use this: in a script you can assign a character (text, word, etc.) an underline colour without setting underline. In the interface you'd have to enable underline, then set a colour, then disable underline. In a script enabling and disabling underline isn't necessary: just set myCharacter.underlineColor to some value ('Black' for "yes", 'White' for "no" or something like that).
So though you can't add new properties to characters, they have so many already that you're sure to find one you can exploit.
This is what I expected, but your suggestion of using the strikeThru color is a very good one, because even if the text requires strikeThru, it can be changed back to black or the text color at the end of the script anyway. Thanks for that info.