Skip to content

Instantly share code, notes, and snippets.

@crsrusl
Created August 3, 2017 12:01
Show Gist options
  • Save crsrusl/67eee8497dd296879fe1a832b3205f0a to your computer and use it in GitHub Desktop.
Save crsrusl/67eee8497dd296879fe1a832b3205f0a to your computer and use it in GitHub Desktop.
tell application "Microsoft Outlook"
set theMessage to first item of (get current messages)
set theSubject to the subject of theMessage
set theBody to the plain text content of theMessage
set theID to the id of theMessage
end tell
tell application "Things3"
show quick entry panel with properties {name:theSubject, notes:theBody}
end tell
@CaseyRo
Copy link

CaseyRo commented Aug 21, 2020

Is it possible to add the email link instead of whole body?

I've considered this as well, but it's pretty hard - there are a few workouts using message ID's but they don't always work (Also need installing of scripts/apps on a mac that I don't really own)

@crsrusl
Copy link
Author

crsrusl commented Aug 25, 2020

Hi, it is possible - I've actually got it working on my machine at the moment. @Keesromkes is correct, you need to create a little helper file and install it.

@fclad
Copy link

fclad commented Oct 30, 2020

Hi!

Thank you for sharing this script. I've been using a variation of it for years and it works great... or used to. It looks like get current messages is broken in the "New Outlook for Mac" that Microsoft released this month. Any clue how that could be fixed? Thanks!

@CaseyRo
Copy link

CaseyRo commented Oct 30, 2020

Hi!

Thank you for sharing this script. I've been using a variation of it for years and it works great... or used to. It looks like get current messages is broken in the "New Outlook for Mac" that Microsoft released this month. Any clue how that could be fixed? Thanks!

Haven't found anything either with new outlook, might be that applescript is still not supported - hopefully they'll add that again later, or just support general sharing on Mac Sur.

@Zenocolo
Copy link

Hey, I managed to fix with changing selection call: set theMessage to selection
My script bellow also adds link to message as described in comment here: https://medium.com/@zenocolo78/hey-russel-thank-you-very-much-this-really-helped-me-since-due-company-policy-i-have-to-use-1b8049c3ff66

tell application "Microsoft Outlook"
set theMessage to selection
set theSubject to the subject of theMessage
set theBody to the plain text content of theMessage
set theID to the id of theMessage
end tell

tell application "Things3"
show quick entry panel with properties {name:theSubject, notes:"outlook://" & theID & linefeed & theBody}
end tell

@EthanHeadlongJr
Copy link

Hi, thanks for the script and for the continued support.

I'm stuggling to get the "selection" approach to work, it's not picking up the highlighted message in New Outlook, all I'm getting in Things is a blank task.

@CaseyRo
Copy link

CaseyRo commented Nov 18, 2020

@EthanHeadlongJr @Zenocolo doesn't seem to be the solution unfortunately! The outlook version (16.43) I'm using still doesn't give anything back when using set theMessage to selection

@Zenocolo
Copy link

Hmmm, works here, I'm using 16.44. I think issue I see it works only if I select one message, it will fail if you select several messages. Just to be clear, the tell application "Things3" part is customised to my environment and adds links to things reminder, this will not work if you dont have helper utility installed.

@CaseyRo
Copy link

CaseyRo commented Nov 18, 2020

@Zenocolo - to me it already failed at set theMessage to selection part, maybe MS added applescript again to 16.44?

@22Nad
Copy link

22Nad commented Apr 5, 2022

Hi, I just stumbled upon this. Am not an experienced coder at all, but I was trying to install the code @Zenocolo proposed. I get the following respons: "Can’t get subject of missing value". Does anyone know how to get this to work?

@jonasdiemer
Copy link

Hi, I just stumbled upon this. Am not an experienced coder at all, but I was trying to install the code @Zenocolo proposed. I get the following respons: "Can’t get subject of missing value". Does anyone know how to get this to work?

Apparently, the "New Outlook" doesn't support automation via AppleScript. So seems like we need to wait for Microsoft to add this (again) - or maybe someone is aware of a workaround?

@CaseyRo
Copy link

CaseyRo commented May 10, 2022 via email

@mxvaic
Copy link

mxvaic commented Dec 1, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment