Thanks for the idea.
Yes. I did try that.
The problem I run into there is getting the filename of the current document changed to save to the correct file.
I can alter the path (C:\\Users\\len\\Desktop), but not the filename, by analyzing the generated script code (below).
Here's what it output:
var idsave = charIDToTypeID( "save" );
var desc2 = new ActionDescriptor();
var idAs = charIDToTypeID( "As " );
desc2.putString( idAs, """Portable Bit Map""" );
var idIn = charIDToTypeID( "In " );
desc2.putPath( idIn, new File( "C:\\Users\\len\\Desktop" ) );
var idDocI = charIDToTypeID( "DocI" );
desc2.putInteger( idDocI, 37 );
var idCpy = charIDToTypeID( "Cpy " );
desc2.putBoolean( idCpy, true );
var idsaveStage = stringIDToTypeID( "saveStage" );
var idsaveStageType = stringIDToTypeID( "saveStageType" );
var idsaveBegin = stringIDToTypeID( "saveBegin" );
desc2.putEnumerated( idsaveStage, idsaveStageType, idsaveBegin );
executeAction( idsave, desc2, DialogModes.NO );