I didn't find a 'clean' way to do this through the DOM. As a workaround you can emulate a "Convert to button" action, provided your script is allowed to select the textframe target:
// convertToButton for ID CS4
function convertToButton(/*PageItem*/obj, /*str*/bName, /*str*/bDesc)
{
app.selection = [obj];
var maCreateButton = app.menuActions.item('$ID/$$$/Dialog/CmdName/CreateButton'),
ret;
if( !maCreateButton.isValid ) return false;
maCreateButton.invoke();
ret = app.selection[0];
ret.name = bName||ret.name;
ret.description = bDesc||ret.description;
return ret;
};
// sample code
var myTextFrame = app.activeDocument.textFrames[0];
var myButton = convertToButton(myTextFrame);
Note: this approach is used in FlyingButtons:
http://www.indiscripts.com/post/2010/03/flyingbuttons-a-script-to-automate-pdf-portfolios
@+
Marc