0

Google 스프레드 시트가 30 개 이상있는 Google 드라이브 폴더가 있습니다. 각 시트에는 5 개 이상의 탭이 있으며 각 탭에는 적어도 하나의 보호 된 셀 세트 또는 탭 자체가 있습니다. 나는 보호 된 셀에 대한 이러한 모든 권한을 하나의 Google 시트에 텍스트로 제공하여 권한을 신속하게 확인하고 잠재적으로 권한을 관리 할 수 ​​있는지 궁금합니다. 내 장기적인 목표는 바로 그 하나의 Google 시트에서 바로 보호 된 셀을 관리하는 것입니다. 나는 찾고 있었지만, 나를 올바른 길로 인도하기위한 자원을 찾지 못했습니다.Google 시트에서 Google 보호 셀 관리

답변

1

나는 당신이 원하는 작업을이 스크립트를 writed

작성할 도구 -> 스크립트 편집기에 다음 이동 스프레드 시트를 열거 나 새에게 ceate하는 데 필요한 스크립트를 실행 그런 다음 코드를 복사/붙여 넣기하십시오.

컨테이너 폴더의 ID를 "################"으로 변경하여 폴더의 ID를 확인하십시오 당신은 다음 URL의 일부는 후 ID https://drive.google.com/drive/folders/#########################

에 해당하는 복사 폴더를 열 수 있습니다 메뉴를 추가하려면 새로 고침하여 표시해야합니다.

사용 :

function onOpen(){ 
    var ui = SpreadsheetApp.getUi(); 
    ui.createMenu('Custom Utilities').addItem('Get permisions list Here','testfunction').addToUi(); 
} 

function testfunction() { 
    //Add a new sheet in the current Spreadsheet 
    var activeSheet = SpreadsheetApp.getActiveSpreadsheet().insertSheet().activate(); 
    activeSheet.appendRow(['FileName','ID','Protection Description','Range','Type','Users']); 
    activeSheet.getRange("A1:F1").setFontWeight('bold'); 

    //get all the Google Spreadsheet's files 
    var files = DriveApp.getFolderById("#########################").getFilesByType(MimeType.GOOGLE_SHEETS); 
    while (files.hasNext()) { 
    var file = files.next(); 
    var ss = SpreadsheetApp.openById(file.getId()); 

    //get the permisions in the current file, and print the data to the previous created sheet 
    var protectionsRange = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE); 
    for (var i = 0; i < protectionsRange.length; i++) { 
     var protection = protectionsRange[i]; 

     activeSheet.appendRow([file.getName(),file.getId(),protection.getDescription(),protection.getRange().getA1Notation(),protection.getProtectionType(),protection.getEditors().join(";")]); 
     //Logger.log(file.getName() + " | " + file.getId() + " \n| " + protection.getDescription() + " | " + protection.getRange().getA1Notation() + " | " + protection.getProtectionType() + " | " + protection.getEditors().join(";")); 
    } 
    var protectionsSheet = ss.getProtections(SpreadsheetApp.ProtectionType.SHEET); 
    for (var i = 0; i < protectionsSheet.length; i++) { 
     var protection = protectionsSheet[i]; 
     activeSheet.appendRow([file.getName(),file.getId(),protection.getDescription(),protection.getRange().getA1Notation(),protection.getProtectionType(),protection.getEditors().join(";")]); 
     //Logger.log(file.getName() + " | " + file.getId() + " \n| " + protection.getDescription() + " | " + protection.getRange().getA1Notation() + " | " + protection.getProtectionType() + " | " + protection.getEditors().join(";")); 
    } 
    } 
} 
:> 사용자 정의 유틸리티 - 클릭하십시오 여기에을 '권한 목록 가져 오기 다음은 모든 정보 여기

있을 것이다 "시트 #"을 만듭니다하면 코드

관련 문제