Re: Attachment or no Attachment
Re: Attachment or no Attachment
- Subject: Re: Attachment or no Attachment
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 13 Feb 2002 23:37:13 -0800
On 2/13/02 11:14 PM, "Bart Visser" <email@hidden> wrote:
>
Hi,
>
>
I'm writing a script that sends a return email based on keywords in the
>
subject. I use this handler to make the email:
>
>
on MakeMessage(ToAdres, TheSubject, TheContent, TheAttchment)
>
tell application "Outlook Express"
>
activate
>
set NwMessage to make outgoing message with properties
>
{recipient:ToAdres, subject:TheSubject, content:TheContent,
>
attachment:TheAttachment}
>
move NwMessage to folder "Postvak UIT"
>
end tell
>
end MakeMessage
>
>
Sometimes however there is an attachment, sometimes there isn't. Is there a
>
way to set attachment to 'none'. If tried 'None', 'False' and '""' but the
>
script gives an errormessage.
attachment is (or can be) a list. An empty list {} will work without having
to make any special exceptions. you've also spelled your variable wrong on
your handler parameter (TheAttchment instead of TheAttachment
that will make it error.
set TheAttachment to {}
set attachThisTime to true -- or false
if attachThisTime is true then
tell application "Outlook Express" to set end of TheAttachment to
file:alias "HD:Folder:somethingOrOther" -- one line
end if
on MakeMessage(ToAdres, TheSubject, TheContent, TheAttachment)
tell application "Outlook Express"
activate
set NwMessage to make outgoing message with properties
{recipient:ToAdres, subject:TheSubject, content:TheContent,
attachment:TheAttachment}
move NwMessage to folder "Postvak UIT"
end tell
end MakeMessage
--
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.