4

I've got 200+ jpegs in a folder and need shareable links for each jpeg in a spreadsheet. Is there a way to do this without doing the right clicking thing for each image individually?

3

A method without painful clicking is the following:

  1. Open the desired Google Drive folder and get its ID in the URL from the browser location bar: https://drive.google.com/drive/u/0/folders/<id>

  2. Open a new Google Sheet and navigate Tools > Script editor. In the new script, put (replace the <id> in the code):

    function myFunction() {
      var ss=SpreadsheetApp.getActiveSpreadsheet();
      var s=ss.getActiveSheet();
      var c=s.getActiveCell();
      var fldr=DriveApp.getFolderById("<id>");
      var files=fldr.getFiles();
      var names=[],f,str;
      while (files.hasNext()) {
        f=files.next();
        str='=hyperlink("' + f.getUrl() + '","' + f.getName() + '")';
        names.push([str]);
      }
      s.getRange(c.getRow(),c.getColumn(),names.length).setFormulas(names);
    }
    
  3. Save the script and grant permissions

  4. Run the script

If you revisit the Google Sheet, it should now contain the list of URLs of the files.

(I stole most of this from https://productforums.google.com/forum/#!topic/docs/0ilSDjhFnHI)

2

Yes, you can select all these files and get shareable links to them at once.

  1. Select files
  2. Right-click any of them and pick "Share.." out of the context menu.
  3. Click "Get shareable links" in the upper right corner of the Share dialog window. This does several things at once: makes files accessible to anyone with a link, and copies the links to your clipboard.
  4. Paste into the spreadsheet. The copied links are newline-separated, so when pasted into a spreadsheet, they form a neat column.

Not the answer you're looking for? Browse other questions tagged or ask your own question.