Modify a Google Slides presentation while presenting? - google-apps-script

I'm afraid I already know the answer, but maybe someone else has found a way to do this.
I've been perusing the Slide Apps Script reference, and I'm excited about the possibilities. One thing I would like to do is alter a slide mid-presentation. Specifically, I would like to somehow indicate a link has been clicked.
If links in a presentation turned purple like web links I would settle for that, but I would like to use a trigger when a certain link is clicked or when a certain slide is shown. This trigger could run a script that alters the slide with the link appropriately to show the link has been clicked or even remove the link altogether.
I know the Slides API is behind the others, but Forms have installable triggers that can run onFormSubmit and Spreadsheets have triggers that run onChange and onEdit. I would love to see Slides have an onPresent trigger that ran a script that could detect slide changes with methods like onSlideChange that could report currentSlide. That way we could run scripts while the presentation is showing and take action based on current slides or links.
Aside from Slide specific triggers being added to the API, is there any way to modify slides during a presentation? Or at least show that a link has been clicked?

Related

GOOGLE SLIDES: Prevent User From Moving To The Next Slide Using The Keyboard

I have a very simple presentation that I created using Google Slides and I published it as a website (Publish To The Web). The link is below.
What I want is to prevent the user from navigating the slides (moving to the next slide or previous slide) using the keyboard. I want to force him only to click on the Next Slide / Previous Slide buttons that I created on the slide.
Appreciate your help
https://docs.google.com/presentation/d/e/2PACX-1vQMQdpDXHl2rVIk6dkj8tEcTKYhcBOlW9v-TkCGuggutriEztCrEoI9c9Eazv4_hiufvKeGPa9A4zY4/pub?rm=minimal
Unfortunately, according to an answer from a similar post A Google script to disable keys in a keyboard, Google Apps Script can't disable keys in a keyboard nor includes any service to modify the key behavior in Google Slides or any other Google services.
I know i'm late but I'm pretty sure you just have to right click on the slide and click on skip slide.

Clear certain cells on Window Close AppScript

I wanted an appscript mechanism, where I want to clear certain cells (A2:B8) if the spreadsheet window is closed. I have one way of doing it and that is:
onOpen()
{
sheet.getRange("A2:B8").setValues("");
}
But this seems like a hack but I wanted to know if there's a definite way to do so... like for example:
Browser.onWindowClose()=>{clearCells()}
You maybe able to do this if you have a modal dialog or sidebar open. If sidebar or dialog close is attempted, you may be able to catch the event with beforeunload, if catched, clear all cells using google.script.run(). This assumes user is closing the sidebar before/along with the Google sheets main web app.
There isn't onClose() or onExit() built in trigger as of yet.
Here is the list with all the currently available triggers.
The lack of this feature has already been reported in the IssueTracker.
You can go there and click on the star button to the top left of the page to "increase" the chances for this feature to be implemented by google.
As a side note, clearContent() would be more appropriate:
sheet.getRange("A2:B8").clearContent();

Activating script via button press on embedded Google Sheet

I am trying to embed a Google Spreadsheet that has a script I'd like users to be able to activate. I don't want them to be able to edit anything on the page.
I thought I could do this by
Share sheet and set to edit permissions
Restrict editing on the one sheet I want to share (the images sit above the cells, so I thought this would prevent people from editing cells but allow them to click on the button
Publish to the web
Embed the sheet
Here is the iframe I used:
<iframe width="1250" height=1000 src="https://docs.google.com/spreadsheets/d/e/2PACX-1vRRajy1TK9Y9YQg-Df3bwTy9ktxPECq6T5gS7UfkrYpV_osxwDwRuQClC168B8-o4KsCdFl4kfMYtau/pubhtml?gid=1796260078&single=true&widget=true&headers=false"></iframe>
For context the scripts hide or show different rows. Clicking "show game 2" hides a section of rows and "show game 1" unhides these rows.
The sheet embeds okay but isn't interactable. I have turned off the restricted editing to test (it's back on) and that didn't allow people to edit anything, so I am not sure what I am doing wrong here.
Any help would be greatly appreciated! Cheers!
Workaround:
Use a another button outside the embedded spreadsheet instead.
Publish a headless web-app from your sheet using doPost()
On Button click, use JavaScript to post from your website to apps script web-app
On receiving post request, hide/show the rows using your original script.
References:
Web-app

Google Apps Script; Sidebar OnClose

Is there a way to hook into the CLOSE event of the Ui Sidebar ?
I read up on the docs but could not find one.
Use-Case: User choices on the Sidebar updates the spreadsheet visually like coloring cells for easy visual responses. However, then the user abruptly closes the Sidebar - leaving the physical changes already made to the spreadsheet (such as coloring). To undo those changes, need to hook into close event of Sidebar.
Any ideas / other ways ?

Google Slides API activating script on click of element

I am trying to create a branching scenario using google slides, the idea is that someone viewing the presentation can click on the buttons and see the outcome of their selections.
The first few slides it's easy, it's a 1 to 1 so I can just use the "link" feature in slides.
The tricky part is once you progress to slide 3. I want the slide they are directed to by clicking on the "course of action" options to be based on all the currently selected options.
So here is where I'm stuck - I need to figure out how to have an interaction (click) with the slide in presentation mode trigger a script.
Any suggestions on how to accomplish this in Google Slides?
At this time the Slides Service for Google Apps Script and the Google Slides REST API don't include a way to call a script on a click of an element. This feature is only included on Google Sheets (Clickable images and drawings in Google Sheets)
NOTE: The Google's official documentation very rarely includes a page about missing features. It could be possible that someone already submitted a feature request through the official Issue Tracker. If so, you could star that issue to get notifications about changes on it. Another place to monitor is the G Suite Developers Blog and the Google Apps Script release notes.