0% found this document useful (0 votes)
41 views

Get Link File

The document provides a step-by-step guide on how to obtain Google Drive file links by setting a folder to public and using Google Apps Script. It includes two functions: 'getlinkfile' to retrieve file URLs and 'getnamefile' to get file names from a specified folder. Users are instructed to prepare a spreadsheet and execute the scripts to populate the data in designated cells.

Uploaded by

Naufal Ardenanda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Get Link File

The document provides a step-by-step guide on how to obtain Google Drive file links by setting a folder to public and using Google Apps Script. It includes two functions: 'getlinkfile' to retrieve file URLs and 'getnamefile' to get file names from a specified folder. Users are instructed to prepare a spreadsheet and execute the scripts to populate the data in designated cells.

Uploaded by

Naufal Ardenanda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

MENDAPATKAN LINK FILE GOOGLE DRIVE

- Setting folder menjadi publik


- Siapkan ID folder
- Buat sebuah file spreadsheet
- Klik Ekstensi - Apps script
- Namai scrip yang akan di buat

function getlinkfile() {
var ss=SpreadsheetApp.getActiveSpreadsheet();
var s=ss.getActiveSheet();
var c=s.getRange("a1");
var fldr=DriveApp.getFolderById("<idfolder>");
var files=fldr.getFiles();
var names=[],f,str;
while (files.hasNext()) {
f=files.next();
str=f.getUrl();
names.push([str]);
}
s.getRange(c.getRow(),c.getColumn(),names.length).setFormulas(names); }

function getnamefile() {
var ss=SpreadsheetApp.getActiveSpreadsheet();
var s=ss.getActiveSheet();
var c=s.getRange("b1");
var fldr=DriveApp.getFolderById("<idfolder>");
var files=fldr.getFiles();
var names=[],f,str;
while (files.hasNext()) {
f=files.next();
str = f.getName();
names.push([str]);
}
s.getRange(c.getRow(),c.getColumn(),names.length).setFormulas(names); }

You might also like