This script is used to rename files and folders in Google Drive based on a list of names. This can be done, for example, if you have files with student names in the file name. It works on shared drives and specific folders including their subfolders and files. You can also get a list from the shared drive or folder you want to change the file name on. This can be useful if you are unsure of all the names of files or folders.
Here you list in column A the names that you want to remove from the filenames. You can also enter words if you want to remove them from files and folders.
In this sheet in cell A1, type the shared device ID to tell the script which shared device you want to work with. You must have full access to the shared device.
In this sheet in cell A1, type the value that you want to replace the name or text string in the filename. Keep in mind that it will be added to all the names you have put in the Namelist.
In column A, enter the folder ID if you want to rename files in a specific folder.
Here you will find logs of the changes you make to the files.
Files and folders are listed here when you run the functions List files and folders in Shared Drive and List files and folders in a folder.
Before you begin, make sure to copy this script.
The first time you run the script, you will need to authenticate the script with the Google account you copied it to.
Run the script via the new menu
After reloading the spreadsheet, a new menu, "Filename renamer Scripts", will appear. If you are going to rename files in a shared drive, you need to add the shared drive ID (found in the shared drive url) to cell A1 in the sheet named SharedDriveID. You can only work with one shared drive at a time.
If you are going to rename files in a folder, you need to add the folder ID (found in the folder url). You add the folder IDs to column A in the sheet named.
Available options:
Rename files and folders in Shared Drive: Renames all files and folders in a specified shared drive based on the list in the "Namelist" tab.
Rename files and folders in folders: Renames files and folders in specific folders, including all subfolders.
List files and folders in Shared Drive: Lists all files on the shared drive that you specified in the SharedDriveID sheet you specified.
List files and folders in a folder: Lists all files in the folder you specified in the FolderIDs sheet.