Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // From your pal Pope Snowball:
- // 1) Add all the images into one folder on Google Drive
- // 2) Go to google drive and get the folder ID (after "drive/folders/")
- // 3) Add it to this script below
- // 4) Go to Google Sheets, Tools, Script Editor, New Project, add in the script
- // 5) Highlight the cell you want the URLs to be entered at on your Google Sheet
- // 6) Hit the "Run" button in the Script Editor to run the script
- // Note: You will likely have to give permissions to the Google Drive from the script on first running
- function myFunction() {
- var ss=SpreadsheetApp.getActiveSpreadsheet();
- var s=ss.getActiveSheet();
- var c=s.getActiveCell();
- var fldr=DriveApp.getFolderById("ADD THE GOOGLE DRIVE FOLDER ID HERE"); // Where id is after "drive/folders/" in the url of the google drive folder
- var files=fldr.getFiles();
- var names=[],f,str;
- while (files.hasNext()) {
- f=files.next();
- str='=hyperlink("' + f.getUrl() + '","' + f.getUrl() + '")';
- names.push([str]);
- }
- s.getRange(c.getRow(),c.getColumn(),names.length).setFormulas(names);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement