Hi Brian
I had to modify your code a little - I think it runs on older Leos, and
the API has changed a little since then.
Also, I think you have yours within a plugin? I haven't got to grips with
those yet so instead I have these as a couple of command nodes with key
bindings.
Here's what works for me at the moment
Node: @command insert-outlook-email-link @key=Ctrl-Shift-O
# This command copies outlook link of current selected email into the body
at the current insertion point
import win32com.client
ol = win32com.client.Dispatch("Outlook.Application")
m = ol.ActiveExplorer().Selection.Item(1)
u = "outlook:%s <MESSAGE: %s>" % (m.EntryID, m.Subject)
w = c.frame.body.wrapper
i = w.getInsertPoint()
w.insert(i, u)
Node: @command open-selected-outlook-link @key=@Ctrl-Shift-J
# This command will launch the outlook url (the url text must be selected):
w = c.frame.body.wrapper
r = w.getSelectionRange()
url = w.get(r[0], r[1])
import os
os.startfile(url, 'open')
My next step is probably to make it so that you only have to have cursor
within the URL for this to work. I can probably take code from the
Ctrl-click operation for that. The plugin etc. stuff can wait, for me.
Thanks again!
Jon N
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.