Selections - Adobe 23101764 - Photoshop CS - PC Manual

Scripting guide
Hide thumbs Also See for 23101764 - Photoshop CS - PC:
Table of Contents

Advertisement

5. Create a script to get the font name of the text. An example JavaScript is below:
var textLayer = activeDocument.artLayers[0];
if (textLayer.kind == LayerKind.TEXT)
{
}
6. The name that is displayed in the alert dialog is the PostScript name of the font. Use this
name to set the font of your text For example, the above script returned the name
"ArialMT." The examples below show how to set this font:
AS: set font of textItemRef to "ArialMT"
VB: textLayer.TextItem.Font = "ArialMT"
JS:
3.11.4 Warping text
Warping is another common effect that can be applied to text. To warp a text item-object, set
the object's warp style (WarpStyle/warpStyle) property. The style to set it to is an
enumeration.
AS:
set warp style of textItemRef to flag
VB:
textLayerRef.TextItem.WarpStyle = psFlag
JS:
textLayerRef.textItem.warpStyle = WarpStyle.FLAG;

3.12 Selections

There are instances where you will want to write scripts that only act on the current selection.
If you are writing a script that depends on a selection, be sure to set the selection yourself, as
you cannot test for a non-existent selection. When creating new selections, you can add to,
replace, or subtract from a selection.
Photoshop CS Scripting Guide
alert(textLayer.textItem.font);
textLayer.textItem.font = "ArialMT";
Scripting Photoshop
Selections
3
81

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs

Table of Contents