The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   latest, greatest Entourage to Omnifocus (http://forums.omnigroup.com/showthread.php?t=7769)

rashwell 2008-10-24 03:59 AM

FYI Attachements with Link Backs to Email in Entourage work
 
This script is working for me, most of this was gathered from other threads, unfortunately I have misplaced the original creators names to give credit.

[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 theContent to content of theMessage
set theID to ID of theMessage as string

-- set the path to a temp area on your HD to temporarily store the attachment to be loaded into OF
set theFileName to "YourHDName:Users:Username:Temp:" & theID & ".eml"
save theMessage in theFileName


tell application "OmniFocus"
set theDoc to default document
set theTask to theName
set theNote to theContent
tell quick entry
set NewTask to make new inbox task with properties {name:theTask, note:theContent}
tell the note of NewTask
make new file attachment with properties {file name:theFileName, embedded:true}
end tell
activate
end tell
end tell

-- Remove the file now that it is in OF
tell application "Finder"
delete file theFileName
end tell

-- Only Uncomment if you really understand and are happy with the process and want the message to
-- be removed from Entourage after it gets sent to OF

-- delete theMessage
end repeat
end tell[/CODE]

MB_UST 2008-10-24 04:35 AM

Thanks a lot. I'll try it. As I read it, I see that if the embedded property is set to false, then the file will stay in its original location without copying it to the database (keeping the database leaner). Thanks again (to you and all original the creators).

rburgst 2008-10-29 10:23 PM

I have changed the script slightly and put installation instructions around it. Find it at
[URL="http://rainer.4950.net/wordpress/?p=129"]http://rainer.4950.net/wordpress/?p=129[/URL]

hope you like it

trekkengruven 2008-11-12 08:10 AM

Additional tweaks to entourage script
 
I have two tweaks I wanted to rburgst's current script. I have solved 1 so far:

1 (solved) I wanted to include ONLY a link to the original email into the notes field in omnifocus, and not the body of the email. I sync to the iphone so I want to keep sync times down. I edited this line:

set NewTask to make new inbox task with properties {name:theTask, note:theContent}

and changed it to this:
set NewTask to make new inbox task with properties {name:theTask, note:" "}

Which works well.

2. (unsolved). I want the email link in Omnifocusto open in Entourage. Another post suggested changing the preferences in mail.app to set Entourage as primary, but this does not fix the issue. It opens the email in mail.app regardless. Any ideas? Thanks!

whpalmer4 2008-11-12 08:52 AM

Perhaps if you select one of the linked .eml files in the Finder, do Get Info and set the application to open it with to Entourage (checking the "use this app to open all such files" box) you'll get the result you want.

trekkengruven 2008-11-12 09:13 AM

Thanks for the recommendation, but all my .eml files open with Entourage in the finder (and spotlight) already. It is just when opened within Omnifocus that mail.app launches.

I even double checked a specific eml file that has been added to Omnifocus with this script- in the finder it launches Entourage, Omnifocus still mail.app.

Weird.

whpalmer4 2008-11-12 09:23 AM

Indeed. Have you tried clearing the Launch Services caches and so on? [URL="http://www.thexlab.com/faqs/resetlaunchservices.html"]http://www.thexlab.com/faqs/resetlaunchservices.html[/URL]

trekkengruven 2008-11-12 09:25 AM

Upon further review of Omnifocus preferences, I'm guessing the issue may be that Omnifocus is hard wired to mail.app because of its clipping service integration? I can't think of any other reason why Omnifocus would ignore the finder's type settings.

whpalmer4 2008-11-12 10:10 AM

Yeah, maybe, except it can open everything else under the sun, right? Why have a special check in that code path when you're going to hand everything else off to launch services?

I tried making a link to a .emlx file and following it from OF after setting TextEdit as the default application to open such files. It opened in TextEdit, as I would expect. This was with 10.4.11.

trekkengruven 2008-11-12 10:15 AM

OK, getting closer. I just tried dragging an eml file into Omnifocus (rather than using the script) and indeed it opens in Entourage. So the script must be the culprit? Changing the file association somehow? I'm off to investigate...


All times are GMT -8. The time now is 08:59 PM.

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