This is driving me nuts:
When asking for a property of a textItem like baselineShift, and that property has not been manually set by the user before, it returns undefined even though it may have a default value, as evidenced in the Character properties panel. Is there a workaorund to this bug?
• Put a paragraph style textfield into your document
• Put in some text
• Do not change any of the default values
[ result: undefinded]
• Now set the baseline shift in the properties panel to say 15
[ result: 15 px]
You could wrap the code in a try-clause and return the default value on error.
True,and thanks for the workaround.
But so sad that Adobe is so sloppy about it and does not clean up their act or at least document these flaws.
When working with textItem properties it's good practice to always wrap access and have default value (and maybe user warnings), it can just blow up For example sometimes accessing justification gets in a bad state and only help is resetting the setting in UI.