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 Extras
FAQ Members List Calendar Today's Posts

 
latest, greatest Entourage to Omnifocus Thread Tools Search this Thread Display Modes
OK, solved part 2. Got the solution from Rainer:

http://rainer.4950.net/wordpress/?p=129#comment-67

You were right, whpalmer4, I just misunderstood. I was using an email file from Entourage to try to set the default app in Get Info. Of course that was already set to Entourage.

What I did the second time (and what worked) was to open Mail.app, make a new email, drag that email to the desktop and then assign THAT file (and 'Change All...") to Entourage. Presto. So thanks, all. I am loving life with a streamilined OF DB file...
 
I have a revised version of the scripts discussed here that links directly to an existing Entourage message (not a new copy in /tmp...). This way, if you reply to it, e.g., Entourage knows about it.

The code is a modified version of one posted by Rainer: http://rainer.4950.net/wordpress/?p=129

It uses a spotlight mdfind command to search for the messageID. The file linked in the OF task is a .vRge08Message file which is what Entourage uses to enable spotlight searching (you probably have tens of thousands of these on your computer). When you open one of these files it links back to the original Entourage message.

Enjoy -Josh

Copy the following into 'Script Editor' and save the file in:
~/Documents/Microsoft User Data/Entourage Script Menu Items/

Run it from your Entourage Applescript Menu.

This script makes a new task in the Quick Entry menu with name "MessageSender: Message Subject" and attaches a note with the body of the message and embeds the file link which goes back to Entourage.
Code:
tell application "Microsoft Entourage"
	
	-- get the currently selected message or messages
	set selectedMessages to current messages
	
	-- if there are no messages selected, warn the user and then quit
	if selectedMessages is {} then
		return
	end if
	
	repeat with theMessage in selectedMessages
		
		set theName to subject of theMessage
		set theSender to display name of sender of theMessage
		set theContent to content of theMessage
		set theID to ID of theMessage as string
		
		tell application "OmniFocus"
			log "Importing from Entourage, message ID =  " & theID
		end tell
		
		set theCommand to "mdfind com_microsoft_entourage_recordID==" & theID
		set theMDfile to the first item of paragraphs of (do shell script theCommand)
		
		tell application "OmniFocus"
			tell quick entry
				set theTitle to theSender & ": " & theName
				
				set NewTask to make new inbox task with properties {name:theTitle, note:theContent}
				tell the note of NewTask
					make new file attachment with properties {file name:theMDfile, embedded:false}
				end tell
				
				activate
				
			end tell
		end tell
	end repeat
end tell

Last edited by jshaevitz; 2009-01-31 at 03:06 AM..
 
Here is another script I use which automatically creates a task in Project "Email Reply" with context "email" that links back to Entourage directly. This doesn't open the quick entry menu.

-Josh

Code:
tell application "Microsoft Entourage"
	
	-- get the currently selected message or messages
	set selectedMessages to current messages
	
	-- if there are no messages selected, warn the user and then quit
	if selectedMessages is {} then
		-- display dialog "Please select one or more messages first and then run this script." with icon 1
		return
	end if
	
	repeat with theMessage in selectedMessages
		
		set theName to subject of theMessage
		set theSender to display name of sender of theMessage
		set theContent to content of theMessage
		set theID to ID of theMessage as string
		
		tell application "OmniFocus"
			log "Importing from Entourage, message ID =  " & theID
		end tell
		
		set theCommand to "mdfind com_microsoft_entourage_recordID==" & theID
		set theMDfile to the first item of paragraphs of (do shell script theCommand)
		
		tell application "OmniFocus"
			tell default document
				set theContext to context "email"
				set theProject to project "Email Reply"
				set theTitle to theSender & ": " & theName
				
				set NewTask to make new inbox task with properties {name:theTitle, note:theContent, context:theContext}
				set assigned container of NewTask to theProject
				
				tell the note of NewTask
					make new file attachment with properties {file name:theMDfile, embedded:true}
				end tell
				compact
			end tell
		end tell
		
	end repeat
end tell
 
Is it possible to modify this scrip to add a new inbox item without using Quick Entry? This script would then create the new inbox item without any user interaction.

Thanks
 
The following script makes a new entry in Project: Email Reply with Context:email without opening the quick entry window.

Code:
tell application "Microsoft Entourage"
	
	-- get the currently selected message or messages
	set selectedMessages to current messages
	
	-- if there are no messages selected, warn the user and then quit
	if selectedMessages is {} then
		return
	end if
	
	repeat with theMessage in selectedMessages
		
		set theName to subject of theMessage
		set theSender to display name of sender of theMessage
		set theContent to content of theMessage
		set theID to ID of theMessage as string
		
		tell application "OmniFocus"
			log "Importing from Entourage, message ID =  " & theID
		end tell
		
		set theCommand to "mdfind com_microsoft_entourage_recordID==" & theID
		set theMDfile to the first item of paragraphs of (do shell script theCommand)
		
		tell application "OmniFocus"
			tell default document
				set theContext to context "email"
				set theProject to project "Email Reply"
				set theTitle to theSender & ": " & theName
				
				set NewTask to make new inbox task with properties {name:theTitle, note:theContent, context:theContext}
				set assigned container of NewTask to theProject
				
				tell the note of NewTask
					make new file attachment with properties {file name:theMDfile, embedded:false}
				end tell
				compact
			end tell
		end tell
		
	end repeat
end tell
 
Thank you so much, that was extremely kind of you :-)
 
The script runs fine and imports the Entourage message into an OF task. However, Entourage won't open when I click on the link to the Entourage message in my OF task. Any suggestions?

Thanks,
Chris
 
Not sure why. If you right-click on the file link and "Reveal in Finder" what does it point to?
 
Thanks to all for the work on the scripts!

Oddly, it is working intermittently for me.

With some Ent messages, all works well - I hit Ctl-O and the script attaches the message to the selected OF task, or it opens the Quick entry window to create a new task.

With other messages, it does nothing. I've tried to isolate variables - the message having/not having attachments, or links doesn't seem to make a difference. All messages are in my Ent "in-box" list, selected from the list.

Does anyone else get variation like this? Does Ent treat different messages in the In-box differently?
 
Hoff,

Same question: If you right-click on the file link and "Reveal in Finder" what does it point to? Is there a difference between the links that work and the ones that don't?
 
 




Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to add delegated tasks from entourage to "Waiting" context in OmniFocus tarun101 OmniFocus Extras 1 2010-05-21 08:09 AM
Make it all work between Entourage 2008 and Omnifocus? berntm Applying OmniFocus 1 2009-12-10 07:06 AM
The greatest widget philonous OmniDictionary 4 2008-11-24 02:13 AM
More Entourage to OmniFocus applescripts: this time it's tasks and notes spnyc OmniFocus 1 for Mac 0 2007-06-24 09:10 AM


All times are GMT -8. The time now is 08:37 AM.


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