You can try to learn more about the document container script. You can check the URLs for editing and for users. If the document is not bound to a container, you can access the sharing information in the menu. If this is the last time you use a script, you can also copy the script and delete the original script - either manually or as a document. But take care of any dependencies such as script properties.
I wrote a short loop to record information about the Url container and its viewers:
function containerFinder() {
if (DocumentApp.getActiveDocument()) {
var document = DocumentApp.getActiveDocument();
var editUrl = document.getUrl();
var editors = document.getViewers();
Logger.log("This Script belongs to a document.");
Logger.log("Edit Url: " + editUrl);
Logger.log("Editors: " + editors);
}
else if (SpreadsheetApp.getActiveSpreadsheet()){
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var editUrl = spreadsheet.getUrl();
var editors = spreadsheet.getEditors();
Logger.log("This Script belongs to a spreadsheet.");
Logger.log("Edit Url: " + editUrl);
Logger.log("Editors: " + editors);
}
else if (FormApp.getActiveForm()){
var form = FormApp.getActiveForm();
var editUrl = form.getEditUrl();
var editors = form.getEditors();
Logger.log("This Script belongs to a form.");
Logger.log("Edit Url: " + editUrl);
Logger.log("Editors: " + editors);
}
else {
Logger.log("This Script does not seem to belong to any container.");
}
}
source
share