Show gmail add on on selecting mails from any label - gmail-addons

I am new to write gmail add-ons. Generally Add-ons are shown only when we open 1 thread. My question is: Is there any way to show the add-on on selecting a mail from inbox or any other label, without opening the message thread?

A gmail add-on cannot be triggered when a selection is made through checkbox. But it is a good thought, really. For some reasons , triggering is only possible when you open a thread. However it can also trigger when you switch between messages.

Related

Is it possible to display gmail add-on cards at Inbox or must the user click on a message?

Id like to display a "Home" card if the add-on is opened at inbox, rather than the "Open an Email - Select an email for XYZ to recommend content for you" message. Universal Actions are not quite the same as they're hidden behind the menu icon.
I've been unable to find any examples or code of add-ons that achieves this, is it possible? any help much appreciated
Gmail Addons
Accessing Gmail Addons

Gmail addon action when user is composing a message

Is it possible to create an action to trigger a function whenever the user is composing an email?
I am hoping to add an extra button to the UI for composing emails which will insert some text into the email based on the subject and recipients of the email. Looking through the gmail addon docs I can't seem to find a way to do this.
Would this be something better suited as an actual chrome extension instead?
In short : No
For now , you can not add buttons or any other controls inside the Gmail UI. The add on does not do that. And moreover addons cannot listen into GmailUI except for triggering themselves. Thus we cannot know if the user had started typing into the compose window. It is better to create chrome extensions instead, for these kind of tasks.
Note: Gmail addons are at a nascent state. Probably, we might receive these event handlers at a later stage.

Open Gmail Add-on by default on opening mail

I am working on Gmail Add-on using Google Apps Script.
I wanted to know if there is any way in which my Add-on will be opened by default without clicking on the add-on icon? For example, if the mail contains an attachment, add-on should open without clicking the icon on the sidebar on the right.
As of now, there is no way we can achieve that and that is not possible also because if multiple add ons have similar behaviour on opening mail with attachments, which add on should open. Many race conditions come, so I guess it is not good to have such a feature.

How to apply a Google Apps script to a gmail message from gmail screen

If I have a Google Apps Script that does some processing to a single gmail message, how can I trigger it from the gmail web interface so it gets applied to the message I have currently open on screen?
The closest way I've found is to apply a label and have a background process monitoring labels. Is there a way to add a button or menu option to gmail instead?
Thanks
No, there isn't. At least not using any "native" Apps Script or Gmail feature. You'd have to write a browser extension to achieve this.
Another thing you could do (aside from the special label) is to gmail's URL (while viewing the message) and paste it in your Apps Script interface (previously opened in another tab). Then your script can extract the message id from the URL and work on it right away.
Also, you could do something clever like having your script receive the id (or full gmail url) from a parameter on the script's own url, e.g. https://script.google.com/macros/s/<your-script-key>/exec?gmail=<url>
Then set up your browser (I know Chrome and Firefox do this) to trigger your script and pass the parameter based on a keyword in the location bar. I use mostly just one letter (like "y script" searches the word "script" on youtube. If you use for example "a", you could hit ctrl+L (select location bar), ctrl+c (copies gmail url), ctrl+t (new tab), then type "a ", ctrl+v, enter. Not exactly clicking a button on the gmail's interface, but does the job rather easily. If you're inclined to keyboard shortcuts like I am, this is even a preferable way :)
Another options is to label your message with some label and have an app script scan for this label every X minutes and process all messages it finds.

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.