Created
February 25, 2016 17:57
-
-
Save jkubicek/99a4b67d240f9dca7415 to your computer and use it in GitHub Desktop.
Applescript to open the currently selected Mail message in Gmail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Mail" | |
set the_messages to selected messages of first message viewer | |
set the_headers to all headers of item 1 of the_messages | |
set thecommandstring to "echo \"" & the_headers & "\"| sed -n -e 's/Message-Id: <\\(.*\\)>/\\1/p'" as string | |
set sedResult to do shell script thecommandstring | |
set link to "https://mail.google.com/mail/#search/in%3Aanywhere+rfc822msgid%3A" & sedResult | |
do shell script "open " & link | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment