For those who find it inconvenient to read, everything written in text is explained in the video: Explaining the problem: https://svajok.tinytake.com/msc/MTA1Mjk5OTFfMjQyMjk1NzE explaining what solution I expect: https://svajok.tinytake.com/msc/MTA1MzAwMDhfMjQyMjk1ODg
- I am an admin in the organization's Google account, and the organization has many different files in Google Drive. Many of them have app scripts embedded. When I write this app script, I usually open the Google Sheet I need, click on Extensions-App Script, and write the code I need

- After writing the app script code, the Google system asks me to grant my app script access to my Google account, and I confidently do this (I trust my own code). One of the permissions I grant to the code is "Delete any files on Google Drive".

- Now, I need to grant access to a Google Sheet to a company employee so that he can enter some data into the cells. When I open access, I can choose one of three options: "Viewer", "Commenter", "Editor". Obviously, the user needs to be an "Editor" to perform his work. And here the problem arises:

- If I make the user an editor, he is then allowed not only to enter data into the cells but also to edit the app script code. In theory, he can edit the code in the app script and make it so that when the document is opened, the code deletes all my data from Google Drive (after all, at an earlier stage, I granted the app script access to delete files). This is a security hole. I need users to be able to edit cells in the sheet but not be able to edit the app script.
I asked neural networks how to solve this problem, and they suggested the following solution:
3. Use a separate Apps Script project
Instead of embedding the script in the document, create a separate Apps Script project that will manage the document.
In this case, users will not be able to edit the script, even if they have access to the document.
You can provide access to the document with editing rights, but the script will be under your full control.
I like this idea, but when I ask how to implement it, the neural networks respond quite unclearly; apparently, it can indeed be implemented, but since I do not understand this well enough, I have not been able to link the external script to the Google Sheet. I searched the internet for training videos but found none; all videos show how to write app scripts directly in Excel, but I need to write separately and then link them.
Therefore, I want to order: a video tutorial on how to link an external script to a Google Sheets file. If I encounter any difficulties, I need you to help me establish this connection at least in one document via TeamViewer.