How to get get the "shareable link" of a Google Drive file via Google Apps Script?

Viewed 10975

I thought it would be easy to get the shareable link for a file, like file.getShareableLink() but it seems that things are not so simple.

I've come across similar posts here but nothing that I can understand (alternativeLink and Shareable link for Google Drive file).

Is there really no straightforward way to do this? I've got hundreds of images to extract a shareable link for so they can be displayed online.

2 Answers
Related