Omnifocus link for Outlook 365 webmail

I have found 2 javascript bookmarklets that allow me to:

  1. Get a link to an Outlook 365 email message in their web app [a link that will re-open the email even when it is moved out of the Inbox]
  2. Send the link for that message to Omnifocus and create a task

Is there a way to combine these two scripts to run as one bookmarklet / click / keyboard shortcut?

Bookmarklets pasted below:
Get Outlook Link:
javascript:(function()%20{%20window.open('https://outlook.office365.com/owa/?ItemID='%20.concat(window.location.href.split("/id/")[1])%20.concat('&exvsurl=1&viewmodel=ReadMessageItem')%20)%20;})()

Send to Omnifocus:
javascript:(function(){var%20enc=encodeURIComponent,w=window,frames=w.frames,d=document,tn=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pu=w.location.href,isGMail=w.location.host.match(/mail\.google\.com/),tt=pt=d.title,subjSpans=d.getElementsByClassName("hP"),i,url;if(isGMail){if(subjSpans){tt=subjSpans[0].innerText}else{tt=d.title.substring(d.title.indexOf("-")+1,d.title.lastIndexOf("-")).replace(/^%20+/,"").replace(/%20+$/,"")};if(tn!="")tn+="\n\n";tn+="From%20email%20subject:("+tt+")\n"+pu;pu="https://mail.google.com/mail/u/0/?qs=true&search=query&q=subject:("+enc(tt)+")"};url='omnifocus:///add?note='+enc(tn+"\n"+pu)+'&name='+enc(tt);w.location.href=url})();

1 Like