Applescript for Entourage – HelpSpot integration

We use the terrific HelpSpot help desk software at Emory Law. Often I get emails that really need to be directed into our HelpSpot software so that our help desk folks can assist our customers. I wind up forwarding these emails into HelpSpot, appending ” ##forward:true##” to the subject of the email, so that the emails don’t show me as the customer.

I use Entourage on a Mac as my primary email client. I’ve created an Applescript that can automate this process somewhat. This is the first Applescript I’ve ever written (and it was based on existing code) so any and all suggestions are gratefully accepted.

Here’s how to use this.
1) Start up the AppleScript script editor.
2) Paste all lines in between “Cut Here” and “END CUT” into the script editor.
3) Change the email address from “CHANGEME” to your HelpSpot email address.
4) Save the AppleScript as something like “ForwardHelpSpot.scpt” into the folder “$HOME/Documents/Microsoft User Data/Entourage Script Menu Items”
5) Restart Entourage
6) Highlight a message or messages in Entourage. Invoke the script from the Applescript menu to the far-right of the top of the screen. It will bring up the message with the forward address filled in and the altered subject. Edit the message as required and hit send.

Let me know if you have suggestions or (even better) improvements.

—- Cut Here —-

-- Change message subject to add forward tag and forward to HelpSpot email address
-- Appends ##forward:true## to the subject of message.
-- Sets forward address to HelpSpot incoming email address.
-- Opens window to forward message to HelpSpot email address.

-- Based on a script by Lisa Thompson, lthompson.22@mac.com
--

-- Modifications by Ben Chapman, ben.chapman@emory.edu
-- Tested with Microsoft Entourage 2008
-- Tested in Mac OS 10.5.8

-- You must edit the next line - replace CHANGEME with the email address for your HelpSpot installation.
set HelpSpotEmail to "CHANGEME"

tell application "Microsoft Entourage"
set selectedMessages to current messages
if HelpSpotEmail = "CHANGEME" then

set alertMsg1 to "Please edit the Applescript to add a HelpSpot email address before running this script."
display alert alertMsg1 message "" as informational buttons {"OK"} default button 1 cancel button 1
return
end if
if selectedMessages is {} then

set alertMsg1 to "Please select a message or open a message window before running this script."
display alert alertMsg1 message "" as informational buttons {"OK"} default button 1 cancel button 1
return
end if

repeat with theMessage in selectedMessages

set oldSubject to subject of theMessage
set newSubject to oldSubject & " ##forward:true##"
set subject of theMessage to newSubject
forward theMessage to HelpSpotEmail with opening window
end repeat
end tell

—– END CUT —-

Advertisements

2 thoughts on “Applescript for Entourage – HelpSpot integration

  1. bjchapm says:

    It should be – for some reason the code highlighter will not let me put in something that doesn’t get escaped. Thanks for the correction!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s