1

如何使用 Photoshop 脚本添加投影(具有定义的距离、大小等)?

当前的 JS 代码

var fontSize = 14;
var fontName = "Arial-Bold"; // NB: must be postscript name of font!
// This is the colour of the text in RGB
//Click foreground colour in Photoshop, choose your colour and read off the RGB values
//these can then be entered below.
 var textColor = new SolidColor(); 
        textColor.rgb.red  = 255; 
        textColor.rgb.green =255; 
        textColor.rgb.blue = 255; 

var newTextLayer = doc.artLayers.add(); 
newTextLayer.kind = LayerKind.TEXT; 
newTextLayer.textItem.size = fontSize; 
newTextLayer.textItem.font = fontName;
newTextLayer.textItem.contents = ++Count; 
newTextLayer.textItem.color = textColor; 
newTextLayer.textItem.kind = TextType.PARAGRAPHTEXT; 
newTextLayer.textItem.height = fontSize; 
newTextLayer.textItem.width = doc.width -20;
//The line below is the text position (X Y)  IE; 10 Pixels Right 10 Pixels Down
newTextLayer.textItem.position = Array(10, 12); 
//  Can be RIGHTJUSTFIED LEFTJUSTIFIED CENTERJUSTIFIED 
newTextLayer.textItem.justification=Justification.CENTERJUSTIFIED; 
4

1 回答 1

1

我相信没有 API 功能。您可以做的最好的事情是使用Scriptlistner。然后它生成的代码可以在您的脚本中使用。

下面是一些与 Scriptlistner 生成的代码类似的讨论:

http://ps-scripts.com/bb/viewtopic.php?t=586

http://ps-scripts.com/bb/viewtopic.php?t=2207

于 2011-06-24T14:05:32.737 回答