Automate the process for each new entry / form response
You certainly don’t want to manually trigger the script every time a new entry is submitted. In the script editor, click on the menu Resources > Current project’s triggers and set up an automated trigger as follow: