HelpSpot Help Desk Software | HelpSpot Blog | HelpSpot Support

Applescript for Entourage to HelpSpot forward integration


#1

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” 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
http://homepage.mac.com/lthompson.22/applescript/forcamino.html

– 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 ----


#2

Excellent, thanks Ben!! This is great, we’ll definitely be pointing people to this as a resource. Nice work for your first Applescript.