Created
November 8, 2011 21:43
-
-
Save brettkelly/1349348 to your computer and use it in GitHub Desktop.
Get the message:// URL of the selected message in Mail.app
This file contains 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 selectedMsgs to selection | |
repeat with theMsg in selectedMsgs | |
set message_url to "message://%3c" & (the message id of theMsg) & "%3e" | |
tell application "Finder" | |
set the clipboard to message_url as text | |
end tell | |
exit repeat -- leave the repeat loop after one pass | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This AppleScript will grab the URL for the selected message in Apple Mail. If more than one message is selected, it will grab the URL for the first selected message and ignore the rest. The resulting URL will be shoved onto the system clipboard for pasting elsewhere.