Use Anvil to code to open another application?

Hi
So I am building the news aggregator style thing in my app that I am developing. I was wondering in Anvil can we make a button when the user presses it, it will act as mailto:jame@fake.com in html type thing or even like open Microsoft Outlook or is that too advanced to do in anvil or are there restrictions to what we can do here on Anvil

Should do - it’s a browser function, not really an Anvil thing.
What happened when you tried it?

mailto:jame@fake.com

Yes, you can absolutely do that! Just set the mailto: link as the url of a Link component.

If you want to open the email client, just use a mailto:xxx link.

If you want to create your own custom protocol to open another desktop application, you can have a look at this article that shows different techniques.

I have defined my own custom protocol and have used it for years. It only works inside my company, that is I haven’t created any installable package. I have a script that the IT runs on new computers to create the registry keys and install a few scripts.

It is not easy nor safe. I’m thinking of abandoning the custom protocol and adopting another technique described in that article.

Hi
I’m a bit confused about what you mean by this. I am quite new to Python and Anvil.
Could you please show like an excerpt of what you mean?

Hi David.
I haven’t tried it as I am not sure how to put it into code as I am new to Python.

Hi,

please see this example :

https://anvil.works/build#clone:C634T47WWP5O6KSO=GG32TEY36ORGUHPPSYI45FQE

Clicking the link should open up your default mail package on your computer.

2 Likes

Thank you David. That has helped me alot. I assumed we had to code it. but now I see the url part of the link properties.

1 Like

You can add the link dynamically in code as well :

self.link_1.url = "mailto:xxx@domain.com"
1 Like