I was wondering what the limitations are to the scripts you can access from the sheets assignScript() function?
My current code layout is as follows:
function mainCode(){
copyURL = copySheet(templateURL,destinationFolderID, copyName)
images = SpreadsheetApp.openByUrl(copyURL).getSheetByName(sheetName).getImages()
images[0].assignScript("scriptToBeAssigned")
}
function scriptToBeAssigned(){
// another script here that I want to assign to the image in the sheet copy I've made
}
Both of the above functions are bounded to the same spreadsheet (not the copy that is being made, a different one). Currently, after assigning the script, I keep getting an error message when I click on the image saying the script function could not be found. I thought that maybe I was getting that error because it’s bounded to my other spreadsheet. I then tried copying the scriptToBeAssigned() to my function library and assigning it that way but had the same error message pop up. Is there a work around to this? Can I assign a library script or a script bounded to another spreadsheet via assignScript()?
AnonymousTurtle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.