I'm trying to make a quick macro to grab the current date and time and put it in a cell. I want to make this a static time. I made a quick macro by recording and it works as I recorded it, but when I ran the recorded macro it does nothing. I am just doing a now function and then copying it and pasting the value on top. If I split it into two separate macros, it works. I have no idea what I am doing wrong. Any help is appreciated. "Timestamp" does not work. "Now" works. "copypaste" works.
'''
function TimeStamp() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getCurrentCell().setFormulaR1C1('=now()');
spreadsheet.getActiveRange().copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);
};
function Now() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getCurrentCell().setFormulaR1C1('=now()');
};
function copypaste() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getActiveRange().copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);
};
'''