Setting Opacity and Feathering of a selected Brush via script
Hi all - I am working on a script that relies on some preloaded brushes. From what I can gather (I'm traditionally an InDesign scripter), the only way to set opacity is through a preloaded brush. I do have a function in script that checks the brushes, where I'd like to set the opacity and feather weight of these brushes if they exist. I can't figure out how to Action Script it. Does anyone have any guidance? TIA.
var hasBrushes = function(weight) {
function checkStroked(enabled) {
if (enabled != undefined && !enabled)
return;
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(cTID('Brsh'), "Solid" + weight.toString() + "px");
desc1.putReference(cTID('null'), ref1);
executeAction(cTID('slct'), desc1, DialogModes.NO);
};
function checkDotted(enabled) {
if (enabled != undefined && !enabled)
return;
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(cTID('Brsh'), "Dotted" + weight.toString() + "px");
desc1.putReference(cTID('null'), ref1);
executeAction(cTID('slct'), desc1, DialogModes.NO);
};
try {
checkStroked();
checkDotted();
catch(e) { return false; }
return true;
}

