hi!
how to get text layer properties with Action manager?
need text bounds, text origin, font etc
thnx
get text layer properties via Action manager
-
- Posts: 2
- Joined: Fri Dec 01, 2017 6:53 am
-
- Posts: 45
- Joined: Fri Nov 04, 2016 8:29 am
Re: get text layer properties via Action manager
Hi
make sure the layer in question is selected
make sure the layer in question is selected
Code: Select all
aL = app.activeDocument.activeLayer;
if(aL.kind == LayerKind.TEXT) {
aLname = aL.name;
aLbounds = aL.bounds;
aLWidth = aL.bounds[2]-aL.bounds[0];
aLHeight = aL.bounds[3]-aL.bounds[1];
aLpostScriptFontName = aL.textItem.font;
aLFontSize = aL.textItem.size;
aLtextContent = aL.textItem.contents;
alert('Layer name: '+aLname+'\n'+
'Layer Bounds: '+aLbounds+'\n'+
'Layer width: '+aLWidth+'\n'+
'Layer height: '+aLHeight+'\n'+
'Font`s Postscript name : '+aLpostScriptFontName+'\n'+
'Font size (in the actual used unit): '+aLFontSize+'\n'+
'Text content: '+aLtextContent);
};
- Jaroslav Bereza
- Posts: 38
- Joined: Tue Dec 27, 2016 7:22 pm
Re: get text layer properties via Action manager
Hi, check my tool: https://github.com/jardicc/ActionManagerHumanizer
Examples are changing text properties.
Examples are changing text properties.