Is anyone else having trouble with SiteApps.getActivePage()? for me it's only returning the home page, not the active page.
相关问题
- How can I force all files in a folder to be owned
- Google Apps Script: testing doPost() with cURL
- Google Apps Script to turn in, grade, and return a
- Script fails on SpreadsheetApp.openById - Requires
- Split Lines and Bold Text within a ui.alert Window
相关文章
- How to allow access for importrange function via a
- Google app script trigger not working
- Set Date/Time to 00:00:00
- indexOf returning -1 despite object being in the a
- How can my Google Apps Script be run by others the
- How to stop execution of Google Apps Script?
- Profiling the Performance of a Google App Script
- String starts with in Google Script
When directly embedding a gadget into a sites page, this seems to work as expected; however, when copying a page, it appears to fail -- perhaps this fits your scenario?
There's a pending apps-script issue (572) for pages copied from other pages which mentions:
getActivePage is meant to work when you embed the published gadget in Google Sites page. It will return the page in which the GAS Gadget is embedded, otherwise it will return null
Here is a sample code which works perfect for me in Google Sites Apps Script Gadget.
The problem occurs whenever you setHtmlContent() on the page, the original embedding HTML code gets modified and the app stops behaving normally. It then returns the home page of the site whenever you getActiveSite() it...
It's really annoying and I'm quite disappointed about how long google is taking to fix this...