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://developers.google.com/appmaker/tutorials/call-scripts/ | |
* @param {widget} widget - Button widget. | |
* @param {event} | |
*/ | |
function onListFilesClick(widget, event) { | |
var widgets = widget.parent.descendants; | |
var from = widgets.TextBoxFromFolder.value; | |
var to = widgets.TextBoxToFolder.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
/** | |
* https://developers.google.com/appmaker/tutorials/call-scripts/ | |
* @param {widget} widget - Button widget. | |
* @param {event} | |
*/ | |
function onListFilesClick(widget, event) { | |
var widgets = widget.parent.descendants; | |
var from = widgets.TextBoxFromFolder.value; | |
var to = widgets.TextBoxToFolder.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
function pacProcessForm_(url, pickAndCopyFolder) { | |
var appMessage = {}; | |
appMessage.message = 'Pick and Copy data'; | |
var thisName = 'PaC Process Form'; | |
appMessage.title = thisName; | |
appMessage.url = url; | |
var id; | |
var rtn = url.match(/[-\w]{25,}/); |
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 drivePermissionsInsertByEmail_(email, id) { | |
// https://developers.google.com/drive/v2/reference/permissions | |
var value = email; | |
var type = 'user'; | |
var role = 'organizer'; | |
var resource = { | |
'value': value, | |
'type': type, | |
'role': role | |
}; |
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 getGroupRoleByUserEmail_(email) { | |
var gfolderCopyGroupEmail = PropertiesService.getScriptProperties().getProperty('gfolderCopyGroupEmail'); | |
try { | |
var group = GroupsApp.getGroupByEmail(gfolderCopyGroupEmail); | |
return group.getRole(email); | |
} catch(e) { | |
console.warn('Error %s, %s, GroupsApp.group.getRole()', e.name, e.message); | |
} | |
} |
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) { |
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
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
// 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
/* | |
* check: 파일 복사 함수 호출의 반환값으로 다음 작업을 결정합니다. | |
* '1': 계속 진행 | |
* '-1': 프로세스 중단 | |
* '-2': after 트리거 생성 | |
* '-3': hour 트리거 생성 | |
**/ | |
function callFileCopy_(title, id, parentId) { | |
var copiedState = { |