Answered
I want to create a modal button that opens the add a layer style settings window
I want to create a modal button that opens the add a layer style settings window provided by photoshop.

I want to create a modal button that opens the add a layer style settings window provided by photoshop.

@lll1234 – As @Lumigraphics wrote, there are already multiple options with actions and keyboard shortcuts... However, if you do want to put this into a script, one possible code chunk would be:
function s2t(s) {
return app.stringIDToTypeID(s);
}
var descriptor = new ActionDescriptor();
var descriptor2 = new ActionDescriptor();
var reference = new ActionReference();
reference.putProperty( s2t( "property" ), s2t( "blendOptions" ));
reference.putEnumerated( s2t( "layer" ), s2t( "ordinal" ), s2t( "targetEnum" ));
descriptor.putReference( s2t( "null" ), reference );
descriptor2.putClass( s2t( "blendOptions" ), s2t( "blendOptions" ));
descriptor.putObject( s2t( "to" ), s2t( "blendOptions" ), descriptor2 );
executeAction(s2t( "set" ), descriptor, DialogModes.ALL);Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.