Change antialiasing on all text-layers

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

simerus
Posts: 5
Joined: Thu Dec 15, 2016 7:51 pm

Change antialiasing on all text-layers

Post by simerus »

It would be awesome if I could just select the top-group, run the script, and the script loops through all of the textlayers and sets the antialiasing to "smooth". I was wondering if anyone could help me with this task? Or maybe such a script exists already? I've searched the forum without any luck though :cry:

I have som photoshop files that I have forgotten to set the antialiasing on my text-layers, and there's probably several houndreds of text layers nested under multiple groups in each photoshop file :? Reeeally don't want to do this manually :P

Any help would be greatly appreciated! :)


EDIT: This doesn't have anything to do with my original question, but I'm also wondering if anyone has a snippet to collaps all groups in my scene?
User avatar
Jaroslav Bereza
Posts: 38
Joined: Tue Dec 27, 2016 7:22 pm

Re: Change antialiasing on all text-layers

Post by Jaroslav Bereza »

Try this:

Code: Select all

// =======================================================
var idselectAllLayers = stringIDToTypeID( "selectAllLayers" );
var desc37 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref9 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref9.putEnumerated( idLyr, idOrdn, idTrgt );
desc37.putReference( idnull, ref9 );
executeAction( idselectAllLayers, desc37, DialogModes.NO );

// =======================================================
var idsetd = charIDToTypeID( "setd" );
var desc38 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref10 = new ActionReference();
var idPrpr = charIDToTypeID( "Prpr" );
var idAntA = charIDToTypeID( "AntA" );
ref10.putProperty( idPrpr, idAntA );
var idTxLr = charIDToTypeID( "TxLr" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref10.putEnumerated( idTxLr, idOrdn, idTrgt );
desc38.putReference( idnull, ref10 );
var idT = charIDToTypeID( "T " );
var idAnnt = charIDToTypeID( "Annt" );
var idAnSm = charIDToTypeID( "AnSm" ); //your anti-aliasign method here
desc38.putEnumerated( idT, idAnnt, idAnSm );
executeAction( idsetd, desc38, DialogModes.NO );
Anyway this is actionable. So you don't need script.