mdboom/pytoshop

How can I change text in psd?

wannaphong opened this issue · 1 comments

  • psdwriter version: 0.5.0
  • Python version: 3.6.1
  • Operating System: Windows 10 64 bit

Description

How can I change text in psd?
I want to change data from "Hi" in layers 0 as "bye". Can you recommend ?
Thank you for pytoshop.

What I Did

from pytoshop import enums
from pytoshop.user import nested_layers
layers = nested_layers.psd_to_nested_layers(psd)
text1=layers[0]
text1.name # 'Hi'

If you are talking about text in the image itself, there is currently no support for that (and that would be a fairly large undertaking). However, to change the name of the layer, you can simply do:

text1.name = "bye"

in the example above.