This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function processTeamForm(formObject) { | |
var name = formObject.name; | |
var title = formObject.title; | |
var comment = formObject.comment; | |
var emailRecipient = PropertiesService.getScriptProperties().getProperty('email'); | |
var url = ScriptApp.getService().getUrl(); | |
var msgBody = 'This email was sent via the gFolderCopy App.\n\n' | |
+ 'App: \n' + url + '\n\nComment: \n'+ comment | |
+'\n\nName: '+ name+' Email: '+ Session.getActiveUser().getEmail(); | |
MailApp.sendEmail(emailRecipient, title, msgBody); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myFunction() { | |
var url = 'https://docs.google.com/spreadsheets/d/...'; | |
try { | |
// https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app#openByUrl(String) | |
var ss = SpreadsheetApp.openByUrl(url); | |
var sheet = ss.getSheets()[0]; | |
var numRows = sheet.getLastRow(); | |
var range = sheet.getRange(1, 2, numRows, 1); | |
var values = range.getValues(); | |
var now = new Date(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://m.cafe.naver.com/eojji/302 | |
// unit: msec | |
function timeCheck(startTime, needTime) { | |
var nowDate = new Date(); | |
// remain = 6 min - ( now - start ) | |
var remain = 360000 - (nowDate.getTime() - startTime); | |
if (remain < needTime) { | |
return false; | |
} else { | |
return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://m.cafe.naver.com/eojji/303 | |
function sheetAppendFiles_(parentId, data, sheetFolder, sheetFiles) { | |
if (!data || data.length < 1) { | |
return; | |
} | |
var folderData = []; | |
var newDate = new Date(); | |
// title, id | |
// id2, files, fileSize, start, end, file row, parent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* check: 파일 복사 함수 호출의 반환값으로 다음 작업을 결정합니다. | |
* '1': 계속 진행 | |
* '-1': 프로세스 중단 | |
* '-2': after 트리거 생성 | |
* '-3': hour 트리거 생성 | |
**/ | |
function callFileCopy_(title, id, parentId) { | |
var copiedState = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://m.cafe.naver.com/eojji/307 | |
function setPageTokenProperty(value) { | |
PropertiesService.getUserProperties().setProperty('PAGE_TOKEN', value); | |
} | |
function getPageTokenProperty() { | |
var pageTokenProperty = PropertiesService.getUserProperties().getProperty('PAGE_TOKEN'); | |
return pageTokenProperty; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getResponse() { | |
var form = FormApp.getActiveForm(); | |
var formResponses = form.getResponses(); | |
if (!formResponses || formResponses.length < 1) { | |
Logger.log('Not found form.getResponses()'); | |
return; | |
} | |
var len = formResponses.length; | |
var response = formResponses[len - 1]; | |
var responseId = response.getId(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function triggerAfterByName(functionName, time) { | |
ScriptApp.newTrigger(functionName) | |
.timeBased().after(time).create(); | |
console.log('%s, %s, Time: %s - trigger AfterByName', Session.getEffectiveUser().getEmail(), functionName, time); | |
} | |
function setFolderSSIdProperty(value) { | |
return PropertiesService.getUserProperties().setProperty('FOLDER_SS_ID', value); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
window.addEventListener('load', function() { | |
// console.log('Page is loaded'); | |
}); | |
// Prevent forms from submitting. | |
function preventFormSubmit() { | |
var forms = document.querySelectorAll('form'); | |
for (var i = 0; i < forms.length; i++) { | |
forms[i].addEventListener('submit', function(event) { |
OlderNewer