3

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?

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.
2

A method without painful clicking is the following:

Open the desired Google Drive folder and get the [ID] in its URL from the browser location bar:

https://drive.google.com/drive/u/0/folders/[ID]

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("REPLACE_[ID]_HERE");
  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);
}

Run the script (after having saved it and granted permissions) and revisit the Google Sheet, which should now contain the list of URLs.

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

protected by Community Nov 27 '16 at 1:48

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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