Open Gmail Add-on by default on opening mail - google-apps-script

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.

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.

How to access Gmail messages selected (checkbox)

I am trying to build an Add-On for gmail which will perform some actions on a set of messages selected by the user.
Looking at the gmail Apps Script API, I cannot see a method that allows me to do that.
I've noticed that some AddOns operate on selected messages, just like what I want to do. See picture below...
The checkboxes (highlighted in green) tell the AddOn what to operate on.
What am I missing?
The opened menu has options to forward the messages selected by combining them.
Also, I noticed that this AddOn is placed by google along the top. The same happen to the boomerange AddOn. The AddOn I am developing, always appears on the right hand side (pink arrows).
How can you place your addOn along the top menu?
The items you reference with the orange arrows in the image are not Gmail Add-ons, they are actually Chrome Extensions. Chrome Extensions are installed in the browser and they can add functionality by manipulating the DOM (Document Object Model) of a webpage. The chrome extension in question is probably specifically targeting chrome tabs with Gmail loaded and injecting content in the respective pages.
If you want to learn more about developing Chrome Extensions check out the following documentation:
https://developer.chrome.com/extensions/devguide
And for developing gmail specific Chrome Extensions you might want to check out the InboxSDK framework linked below:
https://www.inboxsdk.com/

Show gmail add on on selecting mails from any label

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.

Automatically open an gmail addon card without user clicking on the addon icon

I am looking for a way (I understand does not really seem a good idea) to force my Gmail addon to automatically open a card and display the same.
Basically, the addon should check the current email's tags and then auto trigger some 'showPanel' of the addon.
I see some answers about google sheets, but not getting how to go about this in the Gmail addon without user triggering it.
Additional Chrome Extension way ??:
If this is not something possible. I also have a chrome extension (which the users will have installed) clicking on a link created by the chrome extension can I somehow trigger the addon icons click event?
Apologies if this basic stuff, not able to find any direct useful info.
There is a Chrome extension that allows you to automaticlly open an addon from Gmail, Calendar, Drive and Docs when you open the page in the browser.
https://chrome.google.com/webstore/detail/auto-open-add-on/bcjnialkobgkdkbdclhdnbdcdgdcgdlo

Highlighting / Emphasizing Gmail-Addon

I am building a Gmail Add-On via Google App Scripts that will display provide helpful actions for emails with certain content.
Is there a way for me to highlight / emphasize / flash the icon for my Add-On (on the right hand sidebar)? This would let me notify the user that the Add-On can provide some functionality for the email they're reading.
As of now, there is no such functionality provided by Google team. The only way an add-on is activated by only user action(user has to click on the add ons icon from right side bar).