Authorizing Scripts in Google Sheets
Before you can execute scripts in Google Sheets, you must (in most cases) authorize the scripts of the application you are using.
The principle is quite similar to an Excel file and its macros that you need to activate upon opening the file in order to use them.
Authorizing Scripts
If you try to run a script that requires authorization (and you have not already authorized scripts for this application), the following message is displayed:
After clicking on OK, select your Google account:
Then click on Advanced:
Next, click on Go to Untitled project (unsafe):
And finally, click on Allow:
If needed, you can revoke an authorization granted to an application from your Google account.
If it is a downloaded file and you do not necessarily trust the file's author, feel free to review the Apps Script code of the application for additional security before authorizing it.