Try this:
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Extras')
.addItem('Criar planilha', 'showPrompt')
.addToUi();
}
function showPrompt() {
const ui = SpreadsheetApp.getUi();
const result = ui.prompt(
'Criar Planilha',
'Digite o nome da planilha',
ui.ButtonSet.OK_CANCEL);
const button = result.getSelectedButton();
const text = result.getResponseText();
if (button == ui.Button.OK) {
let ss = SpreadsheetApp.getActiveSpreadsheet();
ss.insertSheet(text);
} else if (button == ui.Button.CANCEL) {
ui.alert('Por favor digite o nome para a planilha.');
} else if (button == ui.Button.CLOSE) {
ui.alert('Alerta fechado.');
}
}
This will create an "Extras" Menu with a "Create Spreadsheet" sub-menu. A warning will appear to enter the sheet name.
Another option would be to add a Drawing and associate a script to it with the name of the script: showPrompt
The following function works, but only calling the function in the terminal.
function criarPagina() {
 var ss = SpreadsheetApp.getActiveSpreadsheet();
 ss.insertSheet("Nome_daPg");
};
However, I want the same task, but calling it by the spreadsheet.– Nay-ton