Building external hyperlinks

I’m getting tripped up on something that’s probably simple… what I’m trying to do is dynamically build an external link based on a modification of a url I’ll copy paste in.

I’m considering moving from Outlook desktop client to Outlook web client. The implication is that I store a bunch of links to individual emails in my wiki. On the desktop side that’s via the outlook:: protocol. In the web client, when you’re looking at a message it looks like this: https://outlook.office.com/mail/archive/id/AAMk... I then need to change the front end to start with https://outlook.office.com/mail/deeplink?ItemID= and then add on some characters at the end &exvsurl=1, then send that as the “href” to a link.

To make it quick (as I will need to do this multiple times per day), my goal is to write a macro so that all I have to do is type <<mail "paste-here">> and have the external link nicely ready to go, but every time I try a different way to do it, tiddlywiki is trying to be helpful and changing things.

This is an example of one of the few ways that didn’t work:

\define mail(url)
{{{ [[$url$]removeprefix[https://outlook.office.com/mail/archive/id/]addprefix[<a href="https://outlook.office.com/mail/deeplink?ItemID=]addsuffix[&exvsurl=1">email</a>]] }}}
\end

<<mail "https://outlook.office.com/mail/archive/id/AAMk....">>

that returns the text I want:
image
but the hover to the link looks like:


and doesn’t work (note that I’m using Node.js for TiddlyWiki)

You want something along these lines:

\define mail(url)
<a href={{{ [<__url__>removeprefix[https://outlook.office.com/mail/archive/id/]addprefix[https://outlook.office.com/mail/deeplink?ItemID=]addsuffix[&exvsurl=1"]] }}}>email</a>
\end

That was it (with last quotation marks removed), thanks again @saqimtiaz!

\define mail(url)
<a target="_blank" href={{{ [<__url__>removeprefix[https://outlook.office.com/mail/archive/id/]addprefix[https://outlook.office.com/mail/deeplink?ItemID=]addsuffix[&exvsurl=1]] }}}>email</a>
\end

<<mail "https://outlook.office.com/mail/archive/id/AAMkADk4MmNh...">>

I am glad this was solved, I just wanted to add later because o my timezone I can appear a little late;

The initial question could be split in two,

  • Replacing part of the URL
  • Presenting the “external link” just follows

Question

  • I would like to know a little more about the local outlook links and how you get/use them (i Have wanted to do this for some time)

Perhaps of interest;

  • I have built an unrefined solution as a proof of concept called protocols.
    • Presented a value, found in text or fieldname containing it tests for a set of name prefixes http/https/file/mailto and refactors them into html links with a pretty title, custom label’s and targets.
    • This could be customised to address your replacing an extended prefix as it constructs an external link.

Why have I commented here?

I want to promote the idea of tools which could be generalised further that responds to named prefixes in content, initially to address all common internet protocols and permit’s deeper control. It is designed to meet the OT Building external hyperlinks but takes it a lot further. Later I may construct an external hyperlink from an email address (contains @?) to a mailto link. But the key idea is pass anything and it will respond to the protocol or prefix.

One could call it a prefix “processor”.

Hi @TW_Tones sounds like an ambitious plan! Our time-zone difference is a shame as I feel like you and I have the most in common with our goals / environments sometimes.

Regarding the outlook: protocol

Once upon a time there was a great software called “Linker for Outlook” by TeamScope. It was amazing, you could click on an individual item in outlook and with a click of a button you could generate a link that could be pasted anywhere. When clicked, if Outlook was running in the background, it would surface the item. I used this constantly to link important emails and integrate into my organizer wiki

The company seems to have been diverted entirely or has been replaced with another of the same name, so I ended up making something of my own that wasn’t quite as good, but worked okay. There are 2 steps:

  1. Have a VBA macro within Outlook desktop that generates a GUID (EntryID it’s called). The macro actually gets the EntryID and then formats it TW style (like [ext[OUTLOOK LINK|outlook:.....]]and puts it into the clipboard. The limitation of EntryID is that it changes if the object is moved from one folder to the next, so the macro actually stores it somewhere outside the inbox for permanent storage and then generates the link.
  2. Some years ago, Microsoft tried to kill the outlook: protocol, but allowed it to be re-enabled via registry. Pretty good instructions on how to enable it are now stored here Shortcuts and the Missing Outlook:// Protocol (slipstick.com)

So, now that I’m evaluating moving to the web version of Outlook, I know I need the functionality and am trying to re-create it. So far now, so good. Let me know if you have any follow-up questions, happy to help in any way I can.

1 Like

I see the value of the Web Version of outlook especially if it allows the Browser address bar to capture an emails URL.

We may share a lot of interests , it seems a common theme may be leveraging corporate tools. I have worked in a number of large corporations and have a life long practice of hacking them. I even found a way in SharePoint to gain full admin rights if the organisation took it from me, I also built a parallel time sheeting system that was easy and mostly automatic that allowed me to submit my timesheets into an inflexible system in 5 seconds, rather than the hour(s) it would normally need (every day/tasks). But my driving principals includes productivity to handle the sometimes dysfunctional corporate environments.

Thanks for the info.

Would the rich links plugin (http://richlinks.tiddlyspot.com/) be something which could be extended for this?
(apologies if this is off target, just had a quick skim)