function setLayerColor()
{
colorNameString = "Rd ";
var id21 = charIDToTypeID( "setd" );
var desc4 = new ActionDescriptor();
var id22 = charIDToTypeID( "null" );
var ref2 = new ActionReference();
var id23 = charIDToTypeID( "Lyr " );
var id24 = charIDToTypeID( "Ordn" );
var id25 = charIDToTypeID( "Trgt" );
ref2.putEnumerated( id23, id24, id25 );
desc4.putReference( id22, ref2 );
var id26 = charIDToTypeID( "T " );
var desc5 = new ActionDescriptor();
var id27 = charIDToTypeID( "Clr " );
var id28 = charIDToTypeID( "Clr " );
var id29 = charIDToTypeID( colorNameString ); // レイヤーカラー
desc5.putEnumerated( id27, id28, id29 );
var id30 = charIDToTypeID( "Lyr " );
desc4.putObject( id26, id30, desc5 );
executeAction( id21, desc4, DialogModes.NO );
}