Change a word in a text layer

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

MIRYAMM

Change a word in a text layer

Post by MIRYAMM »

I have a text layer with the name Mary, this text layer has a layer style, shadows and position.
Need a script to change the word by any other name.

Please someone can help me

hopefully, you can understand me to help me

Regards

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Paul MR

Change a word in a text layer

Post by Paul MR »

You need to have the text layer selected.
Code: Select allactiveDocument.activeLayer.textItem.contents = "New Name";
MIRYAMM

Change a word in a text layer

Post by MIRYAMM »

Paul, thanks for reply, thanks for your time.
The script works perfectly but I have a problem, the "new name" I have to change every time I make a new document, and it is very time consuming to have to open the script for editing.
Need something like this post: bb/viewtopic.php?f=9&t=5180
Or, that the cursor, it was ready for me to write the name I wanted.

Hopefully, you can understand me to help me
Mike Hale

Change a word in a text layer

Post by Mike Hale »

If you just need the name you could use a simple prompt.
Code: Select allvar lName = prompt('Enter name');
if( lName != null ) activeDocument.activeLayer.textItem.contents = lName;
MIRYAMM

Change a word in a text layer

Post by MIRYAMM »

Thanks Paul and Mike

How wonderful is just what I needed.

Regards