In a google spreadsheet script editor I have several files. I need to reorder the files but can't find a way. Tried to move them with mouse and no luck, and there is no other option to move them up or down.
Is there any way or trick to move the script files up or down?
Here is a sample screenshot, which I would like to move util.gs to the bottom:
Do you still look for the method for reordering scripts in a project using GAS? I have commented about this. But the application I did is a CLI tool made of Golang. So I created the GUI application using GAS. I post the detail method as my answer.
Recently, I found the workaround for rearranging scripts in a project. The flow is as follows.
When existing project is overwritten by a script with an unique filename, all scripts in the project are removed and only the file with the unique name is remained. I thought that this can be applied for rearranging scripts.
When the project is updated, a special scope of https://www.googleapis.com/auth/drive.scripts
is required. This was required to be retrieved by OAuth2 process. But by recent Google update, the Manifests was added. Manifests made users easily use the script which needs such special scopes.
When above flow is reflected to GAS script, the application is as follows.
For rearranging scripts, there is one important point. When scripts in a project is rearranged, version history of scripts is reset once. So if you don't want to reset the version history, before rearranging, please copy the project. By copying project, the project before rearranging is saved.
Scripts and how to use this are this repo at GitHub.
Is this useful for you?