Answered
Creating preset from action descriptor
Is there a way to create a preset not based on ActionReference (r1), but directly from ActionDescriptor of tool settings (t)? essentially they refer to the same object, just in different ways...
var d = new ActionDescriptor();
var r = new ActionReference();
var r1 = new ActionReference();
r.putClass( s2t( "toolPreset" ));
d.putReference( c2t( "null" ), r );
r1.putProperty( s2t( "property" ), s2t( "currentToolOptions" ));
r1.putEnumerated( s2t( "application" ), s2t( "ordinal" ), s2t( "targetEnum" ));
d.putReference( s2t( "using" ), r1 );
d.putString( s2t( "name" ), 'test name' );
executeAction( s2t( "make" ), d, DialogModes.NO );
r = new ActionReference()
r.putProperty(s2t('property'), s2t('tool'))
r.putEnumerated(s2t('application'), s2t('ordinal'), s2t('targetEnum'))
t = executeActionGet(r).getObjectValue(s2t('currentToolOptions'))
