0

GoogleドライブにはGoogleスプレッドシートが30枚以上あります。各シートには5つ以上のタブがあり、それぞれのタブには少なくとも1つの保護されたセルセットまたはタブ自体があります。保護されたセルのこれらのアクセス許可をすべて1つのGoogleシートにテキストとしてフィードすることが可能で、アクセス権をすばやく見極めることができ、潜在的に管理することができます。私の長期目標は、その1枚のGoogleシートから保護されたセルを直接管理することです。私は探していますが、私を正しい道に追いやるためのリソースは見つかりませんでした。GoogleシートでGoogleの保護されたセルを管理する

答えて

1

私はあなたがしたいタスクを作るためにこのスクリプトを、writed

作成するツール - >スクリプトエディタに、その後 移動をスプレッドシートを開くか、新しいものにceateする必要があるスクリプトを実行しますコードをコピーして貼り付けます。フォルダのIDを決定するためにあなたのコンテナフォルダのIDのための

変更「#########################」、あなたはその後、ID https://drive.google.com/drive/folders/に対応するURL部分をコピーしたフォルダを開くことができます#########################

あなたの後メニューを追加するには、表示するために更新する必要があります。

用途:カスタムユーティリティ - をクリックして>それはここにすべての情報を

を持っています「シート#」を作成し、ここpermisionsリストを取得するコードは次のとおりです。

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(";")); 
    } 
    } 
} 
関連する問題