Copy link to clipboard
Copied
Hello everyone!
I've try to create an UXP plugin by javascript on Photoshop v23.5.
But when I get text content of layer with: layer.textItem, I've got "undefined".
Please help!
layer = require("photoshop").app.activeDocument.layers.getByName("text1");
console.log(layer.kind); # => "text"
console.log(layer.textItem); # => undefined
Copy link to clipboard
Copied
Could you please post screenshots with the pertinent Panels (Toolbar, Layers, Options Bar, …) visible?
If you mean the text itself you need layer.textItem.contents
Copy link to clipboard
Copied
I was facing the same issue.
Found out that access to layer.textItem is supported from v24.2
reference: Layer (adobe.com)
Copy link to clipboard
Copied
Could someone just post a meaningful screenshot?
Found out that access to layer.textItem is supported from v24.2
reference: Layer (adobe.com)
The oldest JavaScript Reference I found is for CS4 and the property textItem existed back then.
Copy link to clipboard
Copied
textItem seems to work perfectly fine in Photoshop CC 2019 (the oldest running version I have access to here).
And in Photoshop 2023 naturally, too.
Copy link to clipboard
Copied
What you are referring to is CEP js scripting. CEP / Extendscript does have support for layer.textItem.
@Ba Nguyen 's query was about developing a plugin for Photoshop v23.5 using UXP.
Docs Reference
Copy link to clipboard
Copied
Thanks; sorry, I had misunderstood the OP.