PhotoShop 脚本学习07 新建文字图层

文档.artLayers.add()添加图层
图层.kind=LayerKind.TEXT;设置图层类型
var docRef = app.documents.add(500,300);    //新建文件
var artLayerRef = docRef.artLayers.add();       //新建图层
artLayerRef.kind = LayerKind.TEXT;                  //图层类型设置
var textItemRef = artLayerRef.textItem;             //申明文本对象引用
textItemRef.contents = "Hello,PhotoShop Script!";   //设置文本内容
textItemRef.size = 40;     //设置文本大小
artLayerRef.translate (0, 120);     //文本位置偏移,左上角为原点

 

猜你喜欢

转载自www.cnblogs.com/52vsto/p/12262758.html
今日推荐