Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing multiple text layers

Status
Not open for further replies.

punatichi

Instructor
Feb 19, 2007
7
US
Is there a way to change the font for multiple text layers all at once?
 
You could use a script, here is an example, it will change ALL text layers to the selected font.
This was writen for PSCS2/3
Save the code as FileName.jsx and to run it:
File-Scripts-Browse to where you saved it and select it.
Select your font and click ok.

Paul.

//////////
#target photoshop
function main(){
dlg="dialog{text:'Script Interface',bounds:[100,100,400,230],"+
"panel0:panel{bounds:[10,10,290,120] , text:'' ,properties:{borderStyle:'etched',su1PanelCoordinates:true},"+
"statictext0:StaticText{bounds:[20,10,240,30] , text:'Select Replacement Font' ,properties:{scrolling:undefined,multiline:undefined}},"+
"dropdown0:DropDownList{bounds:[20,40,260,60]},"+
"button0:Button{bounds:[20,70,120,90] , text:'Ok' },"+
"button1:Button{bounds:[150,70,250,90] , text:'Cancel' }}}";
win = new Window(dlg,"Change Font");
win.center();
for (var i=0,len=app.fonts.length;i<len;i++) {
item = win.panel0.dropdown0.add ('item', "" + app.fonts.name);
};
win.panel0.dropdown0.selection=0;
win.panel0.dropdown0.onChange = function(){
Selection= parseInt(this.selection);
}
var done = false;
while (!done) {
var x = win.show();
if (x == 0 || x == 2) {
win.canceled = true;
done = true;
} else if (x == 1) {
done = true;
var result = valiDate();
if(result != true) {
alert(result);
return;
}else
{
fontName = app.fonts[Selection].postScriptName;
findTextLayer(activeDocument);
}
}
}
}
main();
var Selection=0;
var fontName;
function valiDate(){
return true;
};
function findTextLayer(obj){
if(obj.artLayers.length>0){
for(var z = 0;z<obj.artLayers.length;z++){
if(obj.artLayers[z].kind == LayerKind.TEXT) {
obj.artLayers[z].textItem.font = fontName;
}
}
}
if(obj.layerSets.length > 0){
for(var l=0;l<obj.layerSets.length;l++){
findTextLayer(obj.layerSets[l]);
}
}
}
 

...the alternative is if you only want to change targeted layers press shift/control click each text layer, press the T key, click in the font name field and either use you up and down arrow keys or drop down menu to change the font...

andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top