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?


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:


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()) {
    str='=hyperlink("' + f.getUrl() + '","' + f.getName() + '")';

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)


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.