I've been working up a multistep Applescript (which I'm learning as I go) to change up a bunch of files in Photoshop CC. The last part involves changing the contents of an existing text layer (with paragraph text box set for proper placement/size) in the template file, which it does, but it doesn't honor the attributes of the text layer. Size, leading, and baseline all shrink considerably. If I drag-select the text manually and change it manually, it works as expected: just the text changes. Automated, the text changes, but the size goes from 18pt to 4.29pt. I've been searching and experimenting for hours and can't figure out where this change is coming from. Right now, I'm doing an end run around it by cheating the attributes back with an Action, but I can't believe that's the right way.
Here's the line of code I'm using to make the text change:
setcontentsoftext objectofart layer 1 ofcurrent documentto "Hello" ("hello" will be replaced by contents from a variable; just using it here for testing)
Can anyone explain why this is happening/what I'm doing wrong? The scripting reference hasn't helped much. Thanks in advance!