Google Slides API activating script on click of element - google-apps-script

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.

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.

Google Slides - how to automatically run a google add-on and apply custom layout?

I'm currently working on the implementation of the AppScript add-on for Google Slides.
I want my add-on to start when the user opens a new presentation.
I want the add-on to change the layout of all slides, maybe there is a way to import custom layout from file?
Any ideas how to do it?
You could use the on open (simple or installabl) trigger to add a menu and to do some other tasks that doesn't require user authorization but not to change the layout of all slides as something like that requires authorization. For details see https://developers.google.com/apps-script/guides/triggers

How to show images on text hover in google docs addon

I am new to google docs Add-ons. I am working on an add-on in which I need to show set of image on text hover like tooltip in html
I did not find a way to implement this after hours of googling. please help.
This is not possible.
The above because the Documents Service of Google Apps Script doesn't include "on hover" event / trigger or something similar
The only way is by using a dialog or sidebar and they can only be launched by clicking on a custom menu or by using google.script.run on a previously opened dialog / sidebar.
References
https://developers.google.com/apps-script/guides/doc
https://developers.google.com/apps-script/guides/triggers
https://developers.google.com/apps-script/guides/dialogs
Related
Show Popup of YouTube video within Google Doc

How to create a secondary slide-out in Google Doc add on side bar in Google Apps Script

I have a Google Doc add-on that utilizes the sidebar: no problem there. When one uses the Google research add-on, there is an secondary slide out from the sidebar that shows a preview of a search result (see picture below) when clicked. I am hoping to replicate this behaviour, but I see nothing about it in the api regarding size and limits. I tried having a tooltip pop up on my links in the sidebar, but they appear cut off or under the main Google Doc palette. I have tried a bunch of other Google Doc add-ons to see if any of them replicate this functionality, but they don't. Before I spend hours on this, I want to first ask is anyone know if this is specific permission for Google's sidebar only, or can developers replicate this functionality?
The Research Tool is a direct integration with Docs and Presentations, it's not a Google Apps Script add-on. The freedom to "slide out" within the document is not available to add-ons today.
As one alternative, you could use an accordion affect to collapse your "first page" and overlay the result page, still within the bounds of the sidebar.
A second alternative would be to use a non-modal window, where you'd have more freedom. (resizing there requires client-server exchanges, but is doable)

Custom sidebar addon for Google Docs

I am trying to write a simple add-on for Google Docs. It basically a list of items I want to have visible on the side when I am using Docs. I followed this simple tutorial.
I don't want to publish such a simple add-on unnecessarily. Is there a way that I could use it just within my Google Docs without publishing it ?
If you've just copied the sample code into your document's script, it already works there. To activate the script you have to reopen the document, then in the menus at the top click Custom Menu -> Show sidebar.
You only have to publish a script if you want to share your add-on with other users.
If you still have problems, take a look at Add-on Quickstart. It describes add-on creation process in details.