Go to Publish> Test as Add and Configure New Test. Testing your script will run the code in the document of your choice.
You should be able to take it from there. If you still have problems, read on.
To set up a test, you need to specify which document, form or table you want to run and save the test. Then you can run the test (from the โTest as Addโ pop-up window by clicking the โTestโ button after saving the test setup) and it will execute your code on this document / spreadsheet / form, opening a new tab with this document and executing your code .
To share the script with others (except that they use the same process for themselves, copying / pasting the script into their own script editor), you need to publish it in the online store; for this you need all this .
Hope this helps!
source share