// 2023, use it at your own risk;
if (app.documents.length > 0) {
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
createEllipse ([0,0,activeDocument.width,activeDocument.height], 255, 255, 255);
app.preferences.rulerUnits = originalRulerUnits;
};
//////////////////
function createEllipse (theBounds, theR, theG, theB) {
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
var idmake = stringIDToTypeID( "make" );
var desc15 = new ActionDescriptor();
var idnull = stringIDToTypeID( "null" );
var ref4 = new ActionReference();
var idcontentLayer = stringIDToTypeID( "contentLayer" );
ref4.putClass( idcontentLayer );
desc15.putReference( idnull, ref4 );
var idusing = stringIDToTypeID( "using" );
var desc16 = new ActionDescriptor();
var idtype = stringIDToTypeID( "type" );
var desc17 = new ActionDescriptor();
var idcolor = stringIDToTypeID( "color" );
var desc18 = new ActionDescriptor();
var idred = stringIDToTypeID( "red" );
desc18.putDouble( idred, theR );
var idgrain = stringIDToTypeID( "grain" );
desc18.putDouble( idgrain, theG );
var idblue = stringIDToTypeID( "blue" );
desc18.putDouble( idblue, theB );
var idRGBColor = stringIDToTypeID( "RGBColor" );
desc17.putObject( idcolor, idRGBColor, desc18 );
var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
desc16.putObject( idtype, idsolidColorLayer, desc17 );
var idshape = stringIDToTypeID( "shape" );
var desc19 = new ActionDescriptor();
var idunitValueQuadVersion = stringIDToTypeID( "unitValueQuadVersion" );
desc19.putInteger( idunitValueQuadVersion, 1 );
var idtop = stringIDToTypeID( "top" );
desc19.putUnitDouble( idtop, idpixelsUnit, theBounds[1] );
var idleft = stringIDToTypeID( "left" );
desc19.putUnitDouble( idleft, idpixelsUnit, theBounds[0] );
var idbottom = stringIDToTypeID( "bottom" );
desc19.putUnitDouble( idbottom, idpixelsUnit, theBounds[3] );
var idright = stringIDToTypeID( "right" );
desc19.putUnitDouble( idright, idpixelsUnit, theBounds[2] );
var idellipse = stringIDToTypeID( "ellipse" );
desc16.putObject( idshape, idellipse, desc19 );
var idcontentLayer = stringIDToTypeID( "contentLayer" );
desc15.putObject( idusing, idcontentLayer, desc16 );
var idlayerID = stringIDToTypeID( "layerID" );
desc15.putInteger( idlayerID, 3 );
executeAction( idmake, desc15, DialogModes.NO );
};