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
Prev Previous Post   Next Post Next
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).

using terms from application "Microsoft Entourage"
	-- Trims "foo <>" down to ""
	on trim_address(theAddress)
			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
			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"
			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 (5.2 KB, 491 views)

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 08:35 AM
Feature Request: IM messages into actions lanhsin OmniFocus 1 for Mac 2 2010-03-24 07:29 PM
1.7 : Solution for Add from Entourage? dpwagner OmniFocus 1 for Mac 3 2009-09-02 08:39 AM
Where to park WAISU, in-process Actions? omnibob OmniFocus 1 for Mac 2 2009-04-24 04:15 PM
question about processing mail messages into actions JamesX OmniFocus 1 for Mac 8 2008-11-20 10:22 AM

All times are GMT -8. The time now is 03:36 AM.

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