The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus 1 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Process Entourage messages into Actions SOLUTION!!! Thread Tools Search this Thread Display Modes
I took Omni's script for Apple Mail and modified it with my beginner skills (I taught Applescript to my self an hour ago) to work with Entourage. Most of the code is under the copyright protection of the OmniGroup. So I hope they don't mind since it gives their product added usefulness.

The only caveat is in their code they have a loop that looks like it supposed to process a group of messages and I could not the the loop to work. I kept getting some weird error. Maybe someone could fix that.

Anyway, copy and save this code in Apple Script Editor, then create a rule as shown below (I added the notification rule so that I can see when a new rule appears, since I gave my wife permission to send honey-do's. Dangerous, I know).



Code:
using terms from application "Microsoft Entourage"
	-- Trims "foo <foo@bar.com>" down to "foo@bar.com"
	on trim_address(theAddress)
		try
			set AppleScript's text item delimiters to "<"
			set WithoutPrefix to item 2 of theAddress's text items
			set AppleScript's text item delimiters to ">"
			set MyResult to item 1 of WithoutPrefix's text items
		on error
			set MyResult to theAddress
		end try
		set AppleScript's text item delimiters to {""} --> restore delimiters to default value
		return MyResult
	end trim_address
	
	
	on process_message(theMessage)
		-- Allow the user to type in the full sender address in case our trimming logic doesn't handle the address they are using.
		set theSender to sender of theMessage
		set trimmedSender to address of theSender
		tell application "OmniFocus"
			set AllowedSender to allowed mail senders
			if AllowedSender does not contain trimmedSender and AllowedSender does not contain theSender then
				return
			end if
		end tell
		
		set theSubject to subject of theMessage
		set singleTask to false
		if (theSubject starts with "Fwd: ") then
			-- Whole forwarded messages shouldn't split.
			set singleTask to true
			set theSubject to text 6 through -1 of theSubject
		end if
		set theText to theSubject & return & content of theMessage
		tell application "OmniFocus"
			tell default document
				parse tasks with transport text theText as single task singleTask
			end tell
		end tell
	end process_message
	
	tell application "Microsoft Entourage"
		try
			set theMsg to item 1 of (get current messages)
			log theMsg
			my process_message(theMsg)
		on error m number n
			tell application "OmniFocus"
				log "Exception in Entourage action: (" & n & ") " & m
			end tell
		end try
	end tell
	
end using terms from
Attached Files
File Type: zip MailActionMod.zip (5.2 KB, 244 views)
 
I can't wait to try this at work tomorrow.
 
seems to work great--thanks!!
 
Doesn't work for me. :-(
I have a german system, german entourage and german omnifocus.
maybe that's the problem?
 
Brilliant! Works really well so far. Thanks for posting!
 
This is a great rule-script combo as it runs without any user intervention. Is is possible to make the Entourage message become an attachment in the OmniFocus task?

Thanks
 
FYI: Information about adding a link to the original Entourage message can be found here:

http://forums.omnigroup.com/showthre...?t=7769&page=3
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Links back to Entourage messages have disappeared gokubi OmniFocus Extras 0 2010-08-10 07:35 AM
Feature Request: IM messages into actions lanhsin OmniFocus 1 for Mac 2 2010-03-24 06:29 PM
1.7 : Solution for Add from Entourage? dpwagner OmniFocus 1 for Mac 3 2009-09-02 07:39 AM
Where to park WAISU, in-process Actions? omnibob OmniFocus 1 for Mac 2 2009-04-24 03:15 PM
question about processing mail messages into actions JamesX OmniFocus 1 for Mac 8 2008-11-20 09:22 AM


All times are GMT -8. The time now is 01:53 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.