Getting File Names From a Google Drive Folder.
There are a lot of tools which can list the file name in a folder. However, in Google Drive, there is not a plugin so far. But, a script is available to extract file names from the folder . I would like to share this tip to my team.I found that tip from the following website. So, feel free to check that link.
http://www.acrosswalls.org/ortext-datalinks/list-google-drive-folder-file-names-urls/
- Create a blanksheet
- Go to Tools/Script editor
- In the scripteditor, past the following code
// replace your-folder below with the folder for which you want a listing
function listFolderContents() {
var foldername = 'your-folder';
var folderlisting = 'listing of folder ' + foldername;
var folders = DriveApp.getFoldersByName(foldername)
var folder = folders.next();
var contents = folder.getFiles();
var ss = SpreadsheetApp.create(folderlisting);
var sheet = ss.getActiveSheet();
sheet.appendRow( ['name', 'link'] );
var file;
var name;
var link;
var row;
while(contents.hasNext()) {
file = contents.next();
name = file.getName();
link = file.getUrl();
sheet.appendRow( [name, link] );
}
};
- You might need to change the ‘your-folder’ name with the name of your folder.
- Note that the folder should be in your own drive.
- If you click save and run , it will ask permission, just allow it.
- After that , you will see a new spreadsheet with ‘ list of files in your folder name’ in My Drive .
- Enjoy.
Copying a share folder into your ‘My Drive’
- You can copy a file which is shared with you.
- You can not copy the whole folder.
- There is an addon which can solve this problem.
- The name is Copy Folder.check out the link
https://chrome.google.com/webstore/detail/copy-folder/kfbicpdhiofpicipfggljdhjokjblnhl?hl=en
- When you run it, it will ask you to choose a folder you ‘d like to copy.
- My suggestion is to open that folder before you run the addon.
- That is because you will face trouble to find the exact folder from a lot of folders in your drive.
- So if you click sort button and (Sort last opened by me ), it will make alot easier to navigate.
- Then, you will see a newly copied folder in MyDrive.
- ENJOY!!!
Nyein Chan Ko Ko
