It works with CS5. I had too much problems with CS5, CS5.5 and the CS6 beta on my machine all at the same time so I can't test with CS5.5. However, there shouldn't be a difference between the two revs.
You may want to download the most recent version from CVS on sourceforge:
http://ps-scripts.cvs.sourceforge.net/v ... script.jsx ... script.jsx
I push updates out there on occasion and may have fixed problems with this script in CS5 after I uploaded the last zip file.
I have not tested this with a non-English version of PS in a long time. If the current version does not work and you are using
a localized version of PS, let me know what your PS locale is and I'll see if I can get it fixed.
Here's the output I got:
Code: Select all#target photoshop
//
// radial.jsx
//
//
// Generated Mon Jan 23 2012 12:27:59 GMT-0600
//
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
//
//==================== radial ==============
//
function radial() {
// 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(sTID("contentLayer"));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
var desc3 = new ActionDescriptor();
desc3.putBoolean(cTID('Rvrs'), true);
desc3.putUnitDouble(cTID('Angl'), cTID('#Ang'), 90);
desc3.putEnumerated(cTID('Type'), cTID('GrdT'), cTID('Rdl '));
var desc4 = new ActionDescriptor();
desc4.putString(cTID('Nm '), "$$$/DefaultGradient/BlackWhite=Black, White");
desc4.putEnumerated(cTID('GrdF'), cTID('GrdF'), cTID('CstS'));
desc4.putDouble(cTID('Intr'), 4096);
var list1 = new ActionList();
var desc5 = new ActionDescriptor();
var desc6 = new ActionDescriptor();
desc6.putDouble(cTID('Rd '), 23.9408490434289);
desc6.putDouble(cTID('Grn '), 24.5814661681652);
desc6.putDouble(cTID('Bl '), 23.742514885962);
desc5.putObject(cTID('Clr '), sTID("RGBColor"), desc6);
desc5.putEnumerated(cTID('Type'), cTID('Clry'), cTID('UsrS'));
desc5.putInteger(cTID('Lctn'), 0);
desc5.putInteger(cTID('Mdpn'), 50);
list1.putObject(cTID('Clrt'), desc5);
var desc7 = new ActionDescriptor();
var desc8 = new ActionDescriptor();
desc8.putDouble(cTID('Rd '), 255);
desc8.putDouble(cTID('Grn '), 255);
desc8.putDouble(cTID('Bl '), 255);
desc7.putObject(cTID('Clr '), sTID("RGBColor"), desc8);
desc7.putEnumerated(cTID('Type'), cTID('Clry'), cTID('UsrS'));
desc7.putInteger(cTID('Lctn'), 4096);
desc7.putInteger(cTID('Mdpn'), 50);
list1.putObject(cTID('Clrt'), desc7);
desc4.putList(cTID('Clrs'), list1);
var list2 = new ActionList();
var desc9 = new ActionDescriptor();
desc9.putUnitDouble(cTID('Opct'), cTID('#Prc'), 100);
desc9.putInteger(cTID('Lctn'), 0);
desc9.putInteger(cTID('Mdpn'), 50);
list2.putObject(cTID('TrnS'), desc9);
var desc10 = new ActionDescriptor();
desc10.putUnitDouble(cTID('Opct'), cTID('#Prc'), 100);
desc10.putInteger(cTID('Lctn'), 4096);
desc10.putInteger(cTID('Mdpn'), 50);
list2.putObject(cTID('TrnS'), desc10);
desc4.putList(cTID('Trns'), list2);
desc3.putObject(cTID('Grad'), cTID('Grdn'), desc4);
desc2.putObject(cTID('Type'), sTID("gradientLayer"), desc3);
desc1.putObject(cTID('Usng'), sTID("contentLayer"), desc2);
executeAction(cTID('Mk '), desc1, dialogMode);
};
// Move
function step2(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 ref2 = new ActionReference();
ref2.putIndex(cTID('Lyr '), 0);
desc1.putReference(cTID('T '), ref2);
desc1.putBoolean(cTID('Adjs'), false);
executeAction(cTID('move'), 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(sTID("contentLayer"), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putBoolean(cTID('Rvrs'), true);
desc2.putUnitDouble(cTID('Angl'), cTID('#Ang'), 90);
desc2.putEnumerated(cTID('Type'), cTID('GrdT'), cTID('Rdl '));
desc2.putUnitDouble(cTID('Scl '), cTID('#Prc'), 90);
var desc3 = new ActionDescriptor();
desc3.putString(cTID('Nm '), "$$$/DefaultGradient/BlackWhite=Black, White");
desc3.putEnumerated(cTID('GrdF'), cTID('GrdF'), cTID('CstS'));
desc3.putDouble(cTID('Intr'), 4096);
var list1 = new ActionList();
var desc4 = new ActionDescriptor();
var desc5 = new ActionDescriptor();
desc5.putDouble(cTID('Rd '), 23.9408490434289);
desc5.putDouble(cTID('Grn '), 24.5814661681652);
desc5.putDouble(cTID('Bl '), 23.742514885962);
desc4.putObject(cTID('Clr '), sTID("RGBColor"), desc5);
desc4.putEnumerated(cTID('Type'), cTID('Clry'), cTID('UsrS'));
desc4.putInteger(cTID('Lctn'), 0);
desc4.putInteger(cTID('Mdpn'), 50);
list1.putObject(cTID('Clrt'), desc4);
var desc6 = new ActionDescriptor();
var desc7 = new ActionDescriptor();
desc7.putDouble(cTID('Rd '), 255);
desc7.putDouble(cTID('Grn '), 255);
desc7.putDouble(cTID('Bl '), 255);
desc6.putObject(cTID('Clr '), sTID("RGBColor"), desc7);
desc6.putEnumerated(cTID('Type'), cTID('Clry'), cTID('UsrS'));
desc6.putInteger(cTID('Lctn'), 4096);
desc6.putInteger(cTID('Mdpn'), 50);
list1.putObject(cTID('Clrt'), desc6);
desc3.putList(cTID('Clrs'), list1);
var list2 = new ActionList();
var desc8 = new ActionDescriptor();
desc8.putUnitDouble(cTID('Opct'), cTID('#Prc'), 100);
desc8.putInteger(cTID('Lctn'), 0);
desc8.putInteger(cTID('Mdpn'), 50);
list2.putObject(cTID('TrnS'), desc8);
var desc9 = new ActionDescriptor();
desc9.putUnitDouble(cTID('Opct'), cTID('#Prc'), 100);
desc9.putInteger(cTID('Lctn'), 4096);
desc9.putInteger(cTID('Mdpn'), 50);
list2.putObject(cTID('TrnS'), desc9);
desc3.putList(cTID('Trns'), list2);
desc2.putObject(cTID('Grad'), cTID('Grdn'), desc3);
desc1.putObject(cTID('T '), sTID("gradientLayer"), desc2);
executeAction(cTID('setd'), desc1, dialogMode);
};
step1(); // Make
step2(); // Move
step3(); // Set
};
//=========================================
// radial.main
//=========================================
//
radial.main = function () {
radial();
};
radial.main();
// EOF
"radial.jsx"
// EOF