Applescript can't change font of text layer
I used Applescript to create a text layer and specify its properties, but when I specify the font I get a compile error:
Can’t set «class cFnt» to "TradeGothic-Bold". Access not allowed.
Which sounds like some kind of permission error.
Here's a simplified bit of the script:
tell application "Adobe Photoshop CS4"
tell current document
make new art layer with properties {name:"File Name", kind:text layer}
tell text object of art layer 1
set {contents, size, stroke color, position, kind} to {"thefilename", 12, {class:RGB hex color, hex value:"CC0000"}, {2, 12}, paragraph text}
set font to "TradeGothic-Bold"
end tell
end tell
end tell
If I set the font manually and use "get properties of text object of art layer 1" , the Script Editor returns (along with a long list of other properties):
font:"TradeGothic-Bold"
so I think I've specified the name of the font correctly at least. In the list of properties returned by Script Editor, font is blue as above, but all the other properties names are purple. That's gotta mean something.
