Open Chrome tab through Google Apps Script - google-apps-script

I'm trying to open a new tab in Chrome via Google Apps Script.
My trigger is From spreadsheet - On form submit
Is it possible?
Thanks

This is not possible. Your trigger is executed on form submit. Someone could submit the form without having the Spreadsheet open. So where would the new Chrome window/tab open?
You can have a sidebar in a Google Sheet that can open a new window/tab but that requires human interaction. Meaning, the user would need to go to the Spreadsheet, click on something to load/open the sidebar, and then click a button that would open a new Chrome window/tab.

Related

Use Google App Script to prevent user opening url link in Sheets if site is already open in another browser tab

I've got a Google Sheet that contains numerous hyperlinks.
I'd like to prevent the user from opening multiple instances of the same site.
ie. user clicks the hyperlink in one cell which opens the linked site in a new tab, then attempts to click the same hyperlink while the first new tab is still open - I'd like a dialogue box to appear saying that they cannot open this second new tab until they have closed the first one.
Is this possible via Google App Script?
Many thanks!
Unfortunately not. GAS has no access to your browser data and cannot know what tabs are open.Moreover, GAS has no way of intercepting hyperlink clicks from within a spreadsheet, it can only do that in a side bar, modal (or modeless) dialog, a custom or an add-on menu or an image with a script attached to it.

Keyboard shortcuts in Google Slides Add-on

I'm creating an add-on for Google Slides. My add-on consists of a single button in HTML. Instead of having the user click on the button (which performs an action to the slide), is it possible to create a keyboard shortcut that automatically clicks the button or "calls" the script function?
Not really.
The add-on is in a separate iframe and doesn't have visibility to any keyboard events in the main window. It could capture events in the add-on window, but it only works if the focus is already on the add-on. The overhead of setting the focus properly makes the keyboard shortcut not so useful.

How to tell scripts editor that I want to attach this script to this spreadsheet using the Id I'm currently editing the spreadsheet in

If I have a spreadsheet open and use the menu to open the script editor, the script comes up attached to the wrong Google ID. I am in a Chrome browser session that very clearly shows the correct icon in the upper right corner, but the script editor doesn't recognize the owner of the spreadsheet I've called the editor from

How to enable Inspect function within right-click menu on custom dialog when debugging Google apps script?

I'm developing a file picker function in Google sheet, using Google Picker API. Now I'm able to show a custom dialog window to pick files from my Google drive, but the result doesn't fully meet my needs, I would like to debug and find out any wrong script in HTML which shows in the dialog window. However, when I right-click and select Inspect in a new popup window, it's grey and invalid, unable to debug. What's wrong? Does our company's Google manager restrict users to debug?
Here is a screenshot to show my problem:
Are you able to click outside of the modal and inspect it?
You can also press F12 to open the developer tools.
Also, ctrl+shift+C will open the developer tools with the element picker tool selected.

google app script documentation clear formatting api

I would like to write a google app script to automatically clear the default text formatting of my uploaded/converted google text documents. When editing a google document in google drive, this can be done manually by selecting the text and clicking the the "Format\Clear formatting" drop-down menu item.
I am wondering if there exists such google app api or apis or any other suggestions for doing this programmatically?
Google Apps Script can't run on document upload. So you can't do this without having to install script on every document. And it takes longer than just pressing Ctrl+A and clicking the clear formatting button.