Adding new menu entry from Javascript

I'm trying to update a menu from javascript, my scripts works but i can't see the the new menu entry, even when the record was saved in the table.

 

var file = new SCFile("MENU");
var query = file.doSelect("name=\"ESS MAIN\"");
var go=true;

if(query == RC_SUCCESS){

for (var y=0; y < (file.option.length()-1); y  ){

if (file.description[y]==system.vars.$name) {

print("Already exist " file.description[y]);
go=false;
	}
}

if (go==true){

file.option.push(file.option.length());
file.description.push(system.vars.$name);
file.application.push("menu.manager");
file.pname.push("name");
file.pvalue.push(system.vars.$name);
file.condition.push("true");

print( "Saving changes..." );

//rc=file.doUpdate();
//rc=file.doAction("update");
//rc=file.doSave();

rc=file.doAction("save");
print( 'doAction("save"): '   RCtoString(rc));

		}
	}
}