Copy link to clipboard
Copied
Hi,
I am trying to edit the character styles (Color) in photoshop through JS, for that i did the below coding,
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty( charIDToTypeID( "Prpr" ), charIDToTypeID( "TxtS" ) );
ref1.putEnumerated( charIDToTypeID( "TxLr" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
desc1.putReference( charIDToTypeID( "null" ), ref1 );
var idstrokeColor = stringIDToTypeID( "strokeColor" );
var desc1723 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " );
desc1723.putDouble( idRd, hexToRgb("#"+psd_Color+"").r );
var idGrn = charIDToTypeID( "Grn " );
desc1723.putDouble( idGrn, hexToRgb("#"+psd_Color).g );
var idBl = charIDToTypeID( "Bl " );
desc1723.putDouble( idBl, hexToRgb("#"+psd_Color).b );
desc2.putObject( idstrokeColor, idRGBC, desc1723 );
desc1.putObject( charIDToTypeID( "T " ), charIDToTypeID( "TxtS" ), desc2 );
executeAction(charIDToTypeID( "setd" ), desc1, DialogModes.NO); }
I got an error as below
- Error 8800: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.
- The command “Set” is not currently available.
-> executeAction(charIDToTypeID( "setd" ), desc1, DialogModes.NO);”
Please note some of the PSD files were run successfully, but some files only received this error, i am not sure, how to identify the place which will causes this error.
Please look into this and help me out from this error.
Thanks in Advance
Asuvath
Copy link to clipboard
Copied
Hi,
I am trying to edit the character styles (Color) in photoshop through JS, for that i did the below coding,
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty( charIDToTypeID( "Prpr" ), charIDToTypeID( "TxtS" ) );
ref1.putEnumerated( charIDToTypeID( "TxLr" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
desc1.putReference( charIDToTypeID( "null" ), ref1 );
var idstrokeColor = stringIDToTypeID( "strokeColor" );
var desc1723 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " );
desc1723.putDouble( idRd, hexToRgb("#"+psd_Color+"").r );
var idGrn = charIDToTypeID( "Grn " );
desc1723.putDouble( idGrn, hexToRgb("#"+psd_Color).g );
var idBl = charIDToTypeID( "Bl " );
desc1723.putDouble( idBl, hexToRgb("#"+psd_Color).b );
desc2.putObject( idstrokeColor, idRGBC, desc1723 );
desc1.putObject( charIDToTypeID( "T " ), charIDToTypeID( "TxtS" ), desc2 );
executeAction(charIDToTypeID( "setd" ), desc1, DialogModes.NO); }
I got an error as below
- Error 8800: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.
- The command “Set” is not currently available.
-> executeAction(charIDToTypeID( "setd" ), desc1, DialogModes.NO);”
Please note some of the PSD files were run successfully, but some files only received this error, i am not sure, how to identify the place which will causes this error.
Please look into this and help me out from this error.
Thanks in Advance
Asuvath
Have something to add?