Skip to content

Instantly share code, notes, and snippets.

@chaseroden
Last active August 29, 2015 14:05
Show Gist options
  • Save chaseroden/6d7ff3eee7ad988068ae to your computer and use it in GitHub Desktop.
Save chaseroden/6d7ff3eee7ad988068ae to your computer and use it in GitHub Desktop.
Copies Zendesk ID from Outlook 2011 email to clipboard
set target_string to "\\"
tell application "Microsoft Outlook"
set selectedMessages to current messages
if selectedMessages is {} then
display dialog "Please select a message first and then run this script." with icon 1
return
end if
repeat with theMessage in selectedMessages
-- get the information from the message, and store it in variables
set theName to subject of theMessage
set theCategory to category of theMessage
set theContent to content of theMessage
end repeat
-- display dialog theName
set findIDCommand to "echo -e" & quoted form of theName & " | grep -o -e \\\\[....\\-....\\\\]"
set the clipboard to (do shell script findIDCommand)
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment