appyFontByDom(arguments);

function appyFontByDom(arguments) {
var postScriptname = arguments[0];

try {
		var idsetd = charIDToTypeID( "setd" );
	    var desc48 = new ActionDescriptor();
	    var idnull = charIDToTypeID( "null" );
        var ref43 = new ActionReference();
        var idPrpr = charIDToTypeID( "Prpr" );
        var idTxtS = charIDToTypeID( "TxtS" );
        ref43.putProperty( idPrpr, idTxtS );
        var idTxLr = charIDToTypeID( "TxLr" );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
	    ref43.putEnumerated( idTxLr, idOrdn, idTrgt );
	    desc48.putReference( idnull, ref43 );
	    var idT = charIDToTypeID( "T   " );
        var desc49 = new ActionDescriptor();
        var idtextOverrideFeatureName = stringIDToTypeID( "textOverrideFeatureName" );
        desc49.putInteger( idtextOverrideFeatureName, 808465457 );
        var idtypeStyleOperationType = stringIDToTypeID( "typeStyleOperationType" );
        desc49.putInteger( idtypeStyleOperationType, 3 );
        var idfontPostScriptName = stringIDToTypeID( "fontPostScriptName" );
        desc49.putString( idfontPostScriptName, postScriptname);
	    var idTxtS = charIDToTypeID( "TxtS" );
	    desc48.putObject( idT, idTxtS, desc49 );
		executeAction( idsetd, desc48, DialogModes.NO );
		//return true;

	} catch (e) {
	    beep();
        alert(arguments[1]);
	    //return false;
	}

}