简体   繁体   中英

How to check if the user is idle and switch tabs? via script (Google Spreadsheet - GAS)

I have a Google Spreadsheet and custom function needs to be like this.

  1. Display dialog if the user is idle for 2 mins.
  2. If the user switch to other tab and visited back the spreadsheet, display a dialog.
  3. Upon opening Display a dialog. (Done)

  • Tried to add $(window).on('unload', e => {... but it is not working on .gs only in html.
  • Not sure if I can run the HTML without display just to run the $(window).on('unload', e => {... but I guess this is not possible
  • Tried to use cookies for idle but not applicable too

Appreciate suggestions and solutions. Thank you...

Answer:

Unfortunately, this is currently not possible to do via Google Apps Script.

Feature Request:

You can however let Google know that this is a feature that is important for the Sheets API and that you would like to request they implement it. Google's Issue Tracker is a place for developers to report issues and make feature requests for their development services. The page to file a Feature Request for Apps Script is here .

I hope this is useful to you!

References:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM