Text from layer disappears when updating it via Javascript API

  • 1
  • Problem
  • Updated 2 years ago
I've got a problem with programmatically (via Javascript API) updating text in one of text layers in psd file. The problem is very specific, because it only happens for one of my files, for just one particular text layer in that file.The problem is, when I'm updating layer's text by simply calling
myLayer.textItem.contents = "Any text";
whole text from layer disappears. Layer is still visible on layers list, but it is blank, with no text at all. This code works perfectly for any other text layer in the file. I compared the "broken" layer with other layers from that psd file, but I didn't find any differences. Same font, same formatting, same color, and so on.

Here is a link from where you can download the psd file: http://s000.tinyupload.com/?file_id=15106395125868264658
Originally, the file was far more complex, with images, nested layers and so on. I tried to make it as simple as it can be. Now it just has two text layers - one broken and one totally fine.
Here you can see my test jsx script (also as simple as possible) that presents the mentioned problem: http://s000.tinyupload.com/?file_id=05714254120870157615

I hope you will provide me with any solution. I would really appreciate that.
Photo of Robert Willans

Robert Willans

  • 1 Post
  • 0 Reply Likes

Posted 2 years ago

  • 1

Be the first to post a reply!