Advertisement
Namokonov

getLastUpdateDates

Aug 25th, 2021 (edited)
1,499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //нужно включить Drive Api в сервисах
  2.  
  3. function getLastUpdateDates() {
  4.   let sh = SpreadsheetApp.getActive().getSheetByName('>>');
  5.   sh.getRange("b3:b" + sh.getLastRow()).getValues()
  6.     .forEach((t, i) => {
  7.       let date;
  8.       try {
  9.         date = new Date(Drive.Files.get(getIdFromUrl(t[0]), {supportsTeamDrives: true }).modifiedDate)
  10.       } catch (err) {
  11.         date = err;
  12.       }
  13.  
  14.       sh.getRange("Q" + (i + 3)).setValue(date);
  15.     })
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement