PS是一款栅格图像编辑软件,模块众多。提供了脚本,动态连接库等多种扩展机制,本文演示如何通过脚本实现<strong>完美肌肤</strong>相关功能,展示从互联网收集而来的一个小插件,供大家学习交流,请勿用于商业用途。
1.插件界面
本文界面是一系列功能的一部分,将逐步展示,但是功能界面是共同的,如下图所示:
2.关键代码-完美肌肤
大家可通过源代码阅读,来掌握相关技巧,源代码如下:
cTID = function (s) {
return app.charIDToTypeID(s);
};
sTID = function (s) {
return app.stringIDToTypeID(s);
};
//
//==================== Perfect Skin Pro ==============
//
$._ext_001 = {
run: function PerfectSkinPro() {
// Make
function step1(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putClass(cTID('Lyr '));
desc1.putReference(cTID('null'), ref1);
executeAction(cTID('Mk '), desc1, dialogMode);
};
// Merge Visible
function step2(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putBoolean(cTID('Dplc'), true);
executeAction(sTID('mergeVisible'), desc1, dialogMode);
};
// Set
function step3(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putString(cTID('Nm '), "Blur");
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Make
function step4(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putClass(cTID('Lyr '));
desc1.putReference(cTID('null'), ref1);
executeAction(cTID('Mk '), desc1, dialogMode);
};
// Merge Visible
function step5(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putBoolean(cTID('Dplc'), true);
executeAction(sTID('mergeVisible'), desc1, dialogMode);
};
// Set
function step6(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putString(cTID('Nm '), "Blur II");
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Make
function step7(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putClass(cTID('Lyr '));
desc1.putReference(cTID('null'), ref1);
executeAction(cTID('Mk '), desc1, dialogMode);
};
// Merge Visible
function step8(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putBoolean(cTID('Dplc'), true);
executeAction(sTID('mergeVisible'), desc1, dialogMode);
};
// Set
function step9(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putString(cTID('Nm '), "Details 10px");
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Make
function step10(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putClass(cTID('Lyr '));
desc1.putReference(cTID('null'), ref1);
executeAction(cTID('Mk '), desc1, dialogMode);
};
// Merge Visible
function step11(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putBoolean(cTID('Dplc'), true);
executeAction(sTID('mergeVisible'), desc1, dialogMode);
};
// Set
function step12(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putString(cTID('Nm '), "Details 1px");
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Select
function step13(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(cTID('Lyr '), "Blur");
desc1.putReference(cTID('null'), ref1);
desc1.putBoolean(cTID('MkVs'), false);
executeAction(cTID('slct'), desc1, dialogMode);
};
// Convert to Smart Object
function step14(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
executeAction(sTID('newPlacedLayer'), undefined, dialogMode);
};
// Gaussian Blur
function step15(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putUnitDouble(cTID('Rds '), cTID('#Pxl'), 8);
executeAction(sTID('gaussianBlur'), desc1, dialogMode);
};
// Surface Blur
function step16(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putUnitDouble(cTID('Rds '), cTID('#Pxl'), 35);
desc1.putInteger(cTID('Thsh'), 35);
executeAction(sTID('surfaceBlur'), desc1, dialogMode);
};
// Set
function step17(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putEnumerated(cTID('Md '), cTID('BlnM'), cTID('Lghn'));
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Select
function step18(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(cTID('Lyr '), "Blur II");
desc1.putReference(cTID('null'), ref1);
desc1.putBoolean(cTID('MkVs'), false);
executeAction(cTID('slct'), desc1, dialogMode);
};
// Convert to Smart Object
function step19(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
executeAction(sTID('newPlacedLayer'), undefined, dialogMode);
};
// Gaussian Blur
function step20(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putUnitDouble(cTID('Rds '), cTID('#Pxl'), 8);
executeAction(sTID('gaussianBlur'), desc1, dialogMode);
};
// Surface Blur
function step21(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putUnitDouble(cTID('Rds '), cTID('#Pxl'), 35);
desc1.putInteger(cTID('Thsh'), 35);
executeAction(sTID('surfaceBlur'), desc1, dialogMode);
};
// Select
function step22(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(cTID('Lyr '), "Blur");
desc1.putReference(cTID('null'), ref1);
desc1.putBoolean(cTID('MkVs'), false);
executeAction(cTID('slct'), desc1, dialogMode);
};
// Set
function step23(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
var list1 = new ActionList();
var desc3 = new ActionDescriptor();
var ref2 = new ActionReference();
ref2.putEnumerated(cTID('Chnl'), cTID('Chnl'), cTID('Gry '));
desc3.putReference(cTID('Chnl'), ref2);
desc3.putInteger(cTID('SrcB'), 0);
desc3.putInteger(cTID('Srcl'), 0);
desc3.putInteger(cTID('SrcW'), 255);
desc3.putInteger(cTID('Srcm'), 255);
desc3.putInteger(cTID('DstB'), 0);
desc3.putInteger(cTID('Dstl'), 125);
desc3.putInteger(cTID('DstW'), 125);
desc3.putInteger(cTID('Dstt'), 255);
list1.putObject(cTID('Blnd'), desc3);
desc2.putList(cTID('Blnd'), list1);
var desc4 = new ActionDescriptor();
desc4.putUnitDouble(cTID('Scl '), cTID('#Prc'), 416.666666666667);
desc2.putObject(cTID('Lefx'), cTID('Lefx'), desc4);
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Select
function step24(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(cTID('Lyr '), "Blur II");
desc1.putReference(cTID('null'), ref1);
desc1.putBoolean(cTID('MkVs'), false);
executeAction(cTID('slct'), desc1, dialogMode);
};
// Set
function step25(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putEnumerated(cTID('Md '), cTID('BlnM'), cTID('Mltp'));
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Set
function step26(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
var list1 = new ActionList();
var desc3 = new ActionDescriptor();
var ref2 = new ActionReference();
ref2.putEnumerated(cTID('Chnl'), cTID('Chnl'), cTID('Gry '));
desc3.putReference(cTID('Chnl'), ref2);
desc3.putInteger(cTID('SrcB'), 0);
desc3.putInteger(cTID('Srcl'), 0);
desc3.putInteger(cTID('SrcW'), 255);
desc3.putInteger(cTID('Srcm'), 255);
desc3.putInteger(cTID('DstB'), 0);
desc3.putInteger(cTID('Dstl'), 125);
desc3.putInteger(cTID('DstW'), 125);
desc3.putInteger(cTID('Dstt'), 255);
list1.putObject(cTID('Blnd'), desc3);
desc2.putList(cTID('Blnd'), list1);
var desc4 = new ActionDescriptor();
desc4.putUnitDouble(cTID('Scl '), cTID('#Prc'), 416.666666666667);
desc2.putObject(cTID('Lefx'), cTID('Lefx'), desc4);
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Set
function step27(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putEnumerated(cTID('Md '), cTID('BlnM'), cTID('Drkn'));
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Set
function step28(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putUnitDouble(cTID('Opct'), cTID('#Prc'), 60);
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Select
function step29(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(cTID('Lyr '), "Blur II");
desc1.putReference(cTID('null'), ref1);
desc1.putBoolean(cTID('MkVs'), false);
executeAction(cTID('slct'), desc1, dialogMode);
};
// Select
function step30(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(cTID('Lyr '), "Blur");
desc1.putReference(cTID('null'), ref1);
desc1.putEnumerated(sTID("selectionModifier"), sTID("selectionModifierType"), sTID("addToSelectionContinuous"));
desc1.putBoolean(cTID('MkVs'), false);
executeAction(cTID('slct'), desc1, dialogMode);
};
// Merge Layers
function step31(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
executeAction(sTID('mergeLayersNew'), desc1, dialogMode);
};
// Set
function step32(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putString(cTID('Nm '), "Cleansed Skin");
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Select
function step33(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(cTID('Lyr '), "Details 10px");
desc1.putReference(cTID('null'), ref1);
desc1.putBoolean(cTID('MkVs'), false);
executeAction(cTID('slct'), desc1, dialogMode);
};
// Convert to Smart Object
function step34(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
executeAction(sTID('newPlacedLayer'), undefined, dialogMode);
};
// High Pass
function step35(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putUnitDouble(cTID('Rds '), cTID('#Pxl'), 10);
executeAction(sTID('highPass'), desc1, dialogMode);
};
// Set
function step36(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putEnumerated(cTID('Md '), cTID('BlnM'), cTID('SftL'));
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Set
function step37(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putUnitDouble(cTID('Opct'), cTID('#Prc'), 50);
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Select
function step38(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(cTID('Lyr '), "Details 1px");
desc1.putReference(cTID('null'), ref1);
desc1.putBoolean(cTID('MkVs'), false);
executeAction(cTID('slct'), desc1, dialogMode);
};
// Convert to Smart Object
function step39(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
executeAction(sTID('newPlacedLayer'), undefined, dialogMode);
};
// High Pass
function step40(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putUnitDouble(cTID('Rds '), cTID('#Pxl'), 1);
executeAction(sTID('highPass'), desc1, dialogMode);
};
// Set
function step41(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putEnumerated(cTID('Md '), cTID('BlnM'), sTID("vividLight"));
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Select
function step42(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(cTID('Lyr '), "Cleansed Skin");
desc1.putReference(cTID('null'), ref1);
desc1.putEnumerated(sTID("selectionModifier"), sTID("selectionModifierType"), sTID("addToSelectionContinuous"));
desc1.putBoolean(cTID('MkVs'), false);
executeAction(cTID('slct'), desc1, dialogMode);
};
// Make
function step43(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putClass(sTID("layerSection"));
desc1.putReference(cTID('null'), ref1);
var ref2 = new ActionReference();
ref2.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('From'), ref2);
executeAction(cTID('Mk '), desc1, dialogMode);
};
// Set
function step44(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putString(cTID('Nm '), "Perfect Skin");
desc1.putObject(cTID('T '), cTID('Lyr '), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
// Make
function step45(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putClass(cTID('Nw '), cTID('Chnl'));
var ref1 = new ActionReference();
ref1.putEnumerated(cTID('Chnl'), cTID('Chnl'), cTID('Msk '));
desc1.putReference(cTID('At '), ref1);
desc1.putEnumerated(cTID('Usng'), cTID('UsrM'), cTID('RvlA'));
executeAction(cTID('Mk '), desc1, dialogMode);
};
// Set
function step46(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty(cTID('Clr '), cTID('FrgC'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putUnitDouble(cTID('H '), cTID('#Ang'), 0);
desc2.putDouble(cTID('Strt'), 0);
desc2.putDouble(cTID('Brgh'), 100);
desc1.putObject(cTID('T '), cTID('HSBC'), desc2);
desc1.putString(cTID('Srce'), "photoshopPicker");
executeAction(cTID('setd'), desc1, dialogMode);
};
// Set
function step47(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty(cTID('Clr '), cTID('BckC'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putUnitDouble(cTID('H '), cTID('#Ang'), 0);
desc2.putDouble(cTID('Strt'), 0);
desc2.putDouble(cTID('Brgh'), 0);
desc1.putObject(cTID('T '), cTID('HSBC'), desc2);
desc1.putString(cTID('Srce'), "photoshopPicker");
executeAction(cTID('setd'), desc1, dialogMode);
};
// Fill
function step48(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putEnumerated(cTID('Usng'), cTID('FlCn'), cTID('BckC'));
desc1.putUnitDouble(cTID('Opct'), cTID('#Prc'), 100);
desc1.putEnumerated(cTID('Md '), cTID('BlnM'), cTID('Nrml'));
executeAction(cTID('Fl '), desc1, dialogMode);
};
step1(); // Make
step2(); // Merge Visible
step3(); // Set
step4(); // Make
step5(); // Merge Visible
step6(); // Set
step7(); // Make
step8(); // Merge Visible
step9(); // Set
step10(); // Make
step11(); // Merge Visible
step12(); // Set
step13(); // Select
step14(); // Convert to Smart Object
step15(); // Gaussian Blur
step16(); // Surface Blur
step17(); // Set
step18(); // Select
step19(); // Convert to Smart Object
step20(); // Gaussian Blur
step21(); // Surface Blur
step22(); // Select
step23(); // Set
step24(); // Select
step25(); // Set
step26(); // Set
step27(); // Set
step28(); // Set
step29(); // Select
step30(); // Select
step31(); // Merge Layers
step32(); // Set
step33(); // Select
step34(); // Convert to Smart Object
step35(); // High Pass
step36(); // Set
step37(); // Set
step38(); // Select
step39(); // Convert to Smart Object
step40(); // High Pass
step41(); // Set
step42(); // Select
step43(); // Make
step44(); // Set
step45(); // Make
step46(); // Set
step47(); // Set
step48(); // Fill
},
};
3.作者答疑
代码长度过长,如需全部项目或有疑问,请留言。
提示: 作者知了-联系方式1
提示: 作者知了-联系方式2