On Mar 23, 2011, at 2:29 PM, Fleisher, Ken wrote: I cannot set properties of the text object at the same time as creating the layer because it seems there is no text object yet to assign properties to.
Ken, I agree with you that this seems to be a Photoshop-imposed limitation. Also, I cannot set the contents of contents of the text layer in the same properties assignment because (well, I don’t know why, but the text doesn’t come out right).
set textobj to text object of textlayer
set properties of textobj to {position:{10, h - 10}, justification:left, size:24, ¬ stroke color:{class:Lab color, value_L:55, value_a:20, value_b:0}, font:"Helvetica"} set contents of contents of textobj to "This is text"
It seems to work if you use just "contents" rather than "contents of contents". I would also eliminate the extra step of defining the "textobj" variable:
set properties of text object of textlayer to {kind:point text, position:{10, h - 10}, ¬ justification:left, size:24, stroke color:{class:Lab color, value_L:55, ¬ value_a:20, value_b:0}, font:"Helvetica", contents:"This is text"}
Stan C.
|