Re: Outlook Express script: forward email as attachment
Re: Outlook Express script: forward email as attachment
- Subject: Re: Outlook Express script: forward email as attachment
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 01 Sep 2003 09:26:03 -0700
On 9/1/03 7:51 AM, "Riccardo Cannaviello" <email@hidden> wrote:
>
Is there a reliable AppleScript for Outlook Express 5.0.6 that will forward
>
an email as attachment?
>
>
I run Outlook Express 5.0.6 on OS 9.2.2
Forward how exactly? When you select a message, manually or by a rule, and
run the script, do you want that message to appear as an attachment in a
blank message window on the screen, ready for you to enter To;, Subject: the
message body, etc.? Or do you want to use some pre-existing text for the
message body and perhaps a pre-set recipient? That would allow the message
to be made "behind the scenes" without doing anything on the screen?
In either case, the technique is to save the message (as an .eml file) to
disk, somewhere like the temporary items folder where you won't see
anything, then use the saved file as the location for the attachment. It's
pretty easy, aside from routines which are needed to replace ":" characters
in the name when saving to disk and reducing the name of the file to under
32 characters (since you're in OS 9). In those cases the attachment will
have its name truncated. here's the basic idea for an open message window. I
can't test in OS 9 at the moment since I'm in 10.2
set tempPath to (path to temporary items as string)
tell application "Outlook Express"
set theMsg to item 1 of (get current messages)
set theSubject to subject of theMsg
--routine for replacing colons
set revSubject to my ReplaceColons(theSubject)
set filePath to (tempPath & revSubject)
save theMsg in filePath
set newMsg to make new draft window with properties {attachment:
{file:alias filePath}}
end tell
to ReplaceColons(someText)
set AppleScript's text item delimiters to {":"}
set ls to text items of someText
set AppleScript's text item delimiters to {"-"}
set someText to ls as string
set AppleScript's text item delimiters to {""}
if length of someText > 31 then set someText to text 1 thru 30 of
someText & "
"
return someText
end ReplaceColons
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.