OK, solved part 2. Got the solution from Rainer:
[url]http://rainer.4950.net/wordpress/?p=129#comment-67[/url] 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... |
Solution: Applescript to link OF directly to Entourage Message (using mdfind)
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: [url]http://rainer.4950.net/wordpress/?p=129[/url] 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[/CODE] |
Another script for auto-reply task
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[/CODE] |
Is it possible to modify this scrip to add a new inbox item without using [B]Quick Entry[/B]? 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 [/CODE] |
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?
|
works with some messages, not all?
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? |
All times are GMT -8. The time now is 06:56 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.