Can I add a Google Hangouts call to a Google Sheet? - google-apps-script

I was wondering if it is possible to create a script in Google Sheets to launch a Google Hangout that calls me, preferably by phone but it could also run a video call to my Google+ account.
I currently know how to create a drawing, create a basic function, and assign the script to the drawing to make a button. Just wondering if there is a script out there for this or if it would be possible.
Essentially, I'm trying to add a "Call tech support" button to a complicated spreadsheet.
Thanks in advance!

The best I was able to do was create a button that opens a dialog that shows a "Start a Hangout" button. You can then click that button to open a Hangout window. There may be a way to embed a Hangout window into the dialog directly, but from what I've read, there are restrictions on spreadsheets that prevent some javascript functionality. Here is the code I used:
Code.gs:
function HangoutButton() {
var html = HtmlService.createHtmlOutputFromFile('HangoutButton').setSandboxMode(HtmlService.SandboxMode.IFRAME);
SpreadsheetApp.getUi().showModalDialog(html, 'Loading Hangout Button ...');
}
HangoutButton.html:
<script src="https://apis.google.com/js/platform.js" async defer></script>
<div class="g-hangout" data-render="createhangout"></div>
Here is a link to my working example (it may ask for you to give it permission). It has a button that I have linked to run the HangoutButton() method provided above.

Related

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

Is there a way to call myFunction() from an image, button, or link within a Google Doc, rather than using the menu?

I know that in Google Spreadsheets, you can bind a custom script function to the click event of an image, at least manually via the UI.
But in Google Docs, there doesn't seem to be any equivalent functionality. The only options are timers, onOpen() and ilk, and creating a menu item at the top.
Am I missing a way of adding a function launcher somewhere on the doc itself, especially dynamically from a script? I've searched a bunch and pored over the API docs, but I'm not seeing it.

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 open a new tab after the user click on a button

I'm new in development of Google Chrome extensions.
In my extension, I want to open a new tab after the user click on a button. How I do?
https://developer.chrome.com/extensions/tabs#method-create
This took me a single Google search, a single click on one link, and a single Ctrl-F command. It might be a good idea to look for the answers yourself before posting your questions here.
You can use chrome.tabs.create() for that.
Source: Google Chrome Extensions API
You can use it like this:
<script>
// Uses the Chrome API to create a tab.
function maketab() {
chrome.tabs.create();
}
</script>
<button onclick="maketab()">Click me to make a tab!</button>

disable dismiss hyperlink and message on google spreadsheet

When we run any method of Google App Script,a message appears on Google Spreadsheet with dismiss hyperlink.
For Example:
Running Script methodname Dismiss hyperlink
I would like to know if there is any option to disable the message and dismiss hyperlink that appears on Google Spreadsheet when any function is executed at the back ground. In not , please share what alternates are available to hide this out.
It is within a div of class docs-butterbar-container so on your own machine, you could add
.docs-butterbar-container {
display:none;
}
to a user stylesheet.
But if you are hoping to hide it from other others of your sheets/scripts then your likely out of luck, unless you have means of rolling out user stylesheets.
I also wouldn't recommend hiding this. It's useful.