Copy link to clipboard
Copied
HI, I want to set hardness for a brush, but when I use a function to do so, the spacing and diameter is set to 25 automatically. So I use this function to set hardness, spacing and diameter:
function setBrushFeatures(Diameter,Hardness,Spacing) {
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var appDesc = executeActionGet(ref);
var toolDesc = appDesc.getObjectValue(stringIDToTypeID('currentToolOptions'));
var brushDesc = toolDesc.getObjectValue(stringIDToTypeID('brush'));
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID( "Brsh" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
desc.putReference( charIDToTypeID( "null" ), ref );
var desc1 = new ActionDescriptor();
desc1.putDouble(stringIDToTypeID('diameter'), Diameter);
desc1.putDouble(stringIDToTypeID('hardness'), Hardness);
desc1.putDouble(stringIDToTypeID('spacing'), Spacing);
var desc5 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref3 = new ActionReference();
var idBrsh = charIDToTypeID( "Brsh" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref3.putEnumerated( idBrsh, idOrdn, idTrgt );
desc5.putReference( idnull, ref3 );
desc5.putObject(charIDToTypeID('T '), charIDToTypeID('Brsh'), desc1);
executeAction(charIDToTypeID('setd'), desc5, DialogModes.NO);
}
This works but the spacing is not applied, what am I missing?
Cheers
Matthias
...setBrushFeatures(50,50,50);
function setBrushFeatures(Diameter,Hardness,Spacing) {
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var appDesc = executeActionGet(ref);
var toolDesc = appDesc.getObjectValue(stringIDToTypeID('currentToolOptions'));
var brushDesc = toolDesc.getObjectValue(stringIDToTypeID('brush'));
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( cha
Copy link to clipboard
Copied
setBrushFeatures(50,50,50);
function setBrushFeatures(Diameter,Hardness,Spacing) {
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var appDesc = executeActionGet(ref);
var toolDesc = appDesc.getObjectValue(stringIDToTypeID('currentToolOptions'));
var brushDesc = toolDesc.getObjectValue(stringIDToTypeID('brush'));
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID( "Brsh" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
desc.putReference( charIDToTypeID( "null" ), ref );
var desc1 = new ActionDescriptor();
desc1.putDouble(stringIDToTypeID('diameter'), Diameter);
desc1.putDouble(stringIDToTypeID('hardness'), Hardness);
desc1.putUnitDouble( stringIDToTypeID('spacing'), charIDToTypeID('#Prc'), Spacing);
var desc5 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref3 = new ActionReference();
var idBrsh = charIDToTypeID( "Brsh" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref3.putEnumerated( idBrsh, idOrdn, idTrgt );
desc5.putReference( idnull, ref3 );
desc5.putObject(charIDToTypeID('T '), charIDToTypeID('Brsh'), desc1);
executeAction(charIDToTypeID('setd'), desc5, DialogModes.NO);
};
Copy link to clipboard
Copied
Ah cool, thx, How did you found out that #Prc is needed?
Matthias
Copy link to clipboard
Copied
Just used scriptListener after altering the spacing.
Copy link to clipboard
Copied
ok thx, is there a script listener for photoshop CC 2015 also? can't find it.
Copy link to clipboard
Copied
You should be able to download it from here:-
Copy link to clipboard
Copied
Yes, thank you. But where to put it, in which folder, there is no folder for Plugins or Utilities.
Copy link to clipboard
Copied
It goes in the Applications Plug-ins\Automate folder if they do not exist create the folders.
On my Windows Photoshop 64 bit it is in:
C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Plug-ins\Automate
Copy link to clipboard
Copied
Hi SuperMerlin,
With me, Script listener doesn't output anything when adjusting any brush value. Would you possibly know the reason?
Copy link to clipboard
Copied
The simple answer is ScriptListener does not record everything.
Copy link to clipboard
Copied
Oh, okay, but I thought that the spacing it would show as you said "Just used scriptListener after altering the spacing."?