此脚本将活动图层转换为智能对象:
createSmartObject(app.activeDocument.activeLayer);
function createSmartObject(layer)
{
var idnewPlacedLayer = stringIDToTypeID( 'newPlacedLayer' );
executeAction(idnewPlacedLayer, undefined, DialogModes.NO);
}
我的问题:是否有更短的编码方式?
答案 0 :(得分:0)
createSmartObject();
function createSmartObject() {
var idnewPlacedLayer = stringIDToTypeID( 'newPlacedLayer' );
executeAction(idnewPlacedLayer, undefined, DialogModes.NO);
}
您不需要将层传递给函数-它会作用于当前活动层发生的任何事情。