Let us say I have six Photoshop files: 1.psd, 2.psd, ..., 6.psd. All of these files contain the word "LoremIpsum" in random text layers, within each document. Is there a way I can search for "LoremIpsum" in all documents and replace it with "Dolor Sit Amet", all in one go?
I have tried finding and replacing software (including powerful tools like Power Grep) but they do not work with psd files... Maybe Photoshop variables? However, they only work for one document at once...
Thanks!
Let us say I have six Photoshop files: 1.psd, 2.psd, ..., 6.psd. All of these files contain the word "LoremIpsum" in random text layers, within each document. Is there a way I can search for "LoremIpsum" in all documents and replace it with "Dolor Sit Amet", all in one go?
I have tried finding and replacing software (including powerful tools like Power Grep) but they do not work with psd files... Maybe Photoshop variables? However, they only work for one document at once...
Thanks!
Share Improve this question edited Dec 9, 2013 at 17:58 Malasorte asked Dec 9, 2013 at 17:24 MalasorteMalasorte 1,1837 gold badges23 silver badges47 bronze badges1 Answer
Reset to default 6Use something like the script below. For more info check out your Photoshop JavaScript Reference pdf in your Photoshop install directory.
var dir = new Folder('/c/temp')
var files = dir.getFiles("*.psd");
for (var i = 0; i < files.length; i++) {
var doc = app.open(files[i]);
for (var j= 0; j < doc.artLayers.length; j++) {
var lyr = doc.artLayers[j];
if (lyr.kind == LayerKind.TEXT) {
var lyr = doc.artLayers[j];
lyr.textItem.contents = lyr.textItem.contents.replace("search","replace");
}
}
doc.close(SaveOptions.SAVECHANGES)
}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745293026a4620976.html
评论列表(0条)