Photoshop Scripting: artlayer.textItem returns undefined when asked for a valid property like baselineShift

  • 1
  • Problem
  • Updated 4 years ago
  • (Edited)
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?

To replicate:

• Put a paragraph style textfield into your document
• Put in some text
• Do not change any of the default values
• alert(app.activeDocument.activeLayer.textItem.baselineShift)
[ result: undefinded]

• Now set the baseline shift in the properties panel to say 15
• alert(app.activeDocument.activeLayer.textItem.baselineShift)
[ result: 15 px]
Photo of German Bauer

German Bauer

  • 1 Post
  • 0 Reply Likes
  • frustrated

Posted 4 years ago

  • 1

Be the first to post a reply!