I have solved this issue. Anyway, to get it works I have to use developer options in chrome to find the IDs. Here the script I use.
function onFileMenuItemSelect(args) {
if (args.item.properties.id == "spreadsheet_Xlsx") {
saveToServer();
}
}
function onFileMenuBeforeOpen() {
//this.hideFileMenuItems(['Save As', 'Open', 'New']);
this.enableFileMenuItems([`${this.element.id}_New`], false, true);
this.enableFileMenuItems([`${this.element.id}_Xls`], false, true);
this.enableFileMenuItems([`${this.element.id}_Csv`], false, true);
}
Thank you