Re: Adding an attachment to Entourage
Re: Adding an attachment to Entourage
- Subject: Re: Adding an attachment to Entourage
- From: François Guité <email@hidden>
- Date: Tue, 04 Feb 2003 00:11:38 -0500
You wouldn't believe what happened to me today : Entourage unexpectedly
vanished, taking with it all my mail archives, address book and accounts.
Thank God for applescript-users Mailing List Site Search where I was able to
retrieve the message I had just posted.
The problem remains when I run the applescript (within a field value) inside
a FileMaker script loop (for several records) with the 'Attachment' option
selected (there's no problem with the script when the 'Attachment' option is
null). I've added a few lines in the second 'If' routine, but that doesn't
seem to work either I'm only including the lines which are relevant :
tell application "FileMaker Pro"
(* the next line determines if the path to the file has already been
chosen* )
set fileCHOSEN to cell "Name of cell" of current record -- yields
"chosen" after the first message prompt or "" if no attachmentOPTION
(* this line determines if there is to be an attachment *)
set attachmentOPTION to cell "Attachment" of current record -- true
yields "Attachment" ; false yields "" (global field)
end tell
(* the following 'if' routine sets the optionPROPERTIES for the outgoing
message when there is no attachment *)
if fileCHOSEN is not "chosen" then
set optionPROPERTIES to ""
set theAttachment to ""
end if
(* the following 'if' routine sets the optionPROPERTIES for the outgoing
message when the attachment option is selected, after having asked for the
path to a file attachment for the first record in the loop; it then attempts
to save the path for the following records in the the loop *)
if attachmentOPTION is "Attachment" then
if fileCHOSEN is not "chosen" then
set theAttachment to choose file with prompt "Choose document"
set optionPROPERTIES to "activate attachment"
copy theAttachment to finalAttachment
else
set theAttachment to finalAttachment
end if
end if
tell application "Microsoft Entourage"
activate
if optionPROPERTIES is "activate attachment" then
set theMSG to make new draft window with properties {to
recipients:studentMAILTO, subject:studentSUBJECT,
content:studentCONTENT, attachment:{file:theAttachment}}
end if
if optionPROPERTIES is not "activate attachment" then
set theMSG to make new draft window with properties {to
recipients:studentMAILTO, subject:studentSUBJECT,
content:studentCONTENT}
end if
end tell
I'm so obsessed with the attachment problem that I haven't had the time to
look at the draft window issue, which, you guessed right, I don't really
need.
Thanks for your help and comments. They are dearly appreciated.
Francois Guite
>
> tell application "Microsoft Entourage"
>
> activate
>
> if optionPROPERTIES is "activate attachment" then
>
> set theMSG to make new draft window with properties {to
>
> recipients:studentMAILTO, subject:studentSUBJECT, content:studentCONTENT,
>
> attachment:theAttachment}
>
> end if
>
> if optionPROPERTIES is not "activate attachment" then
>
> set theMSG to make new draft window with properties {to
>
> recipients:studentMAILTO, subject:studentSUBJECT, content:studentCONTENT}
>
> end if
>
> end tell
>
>
>
> Would someone be so kind as to help me with this?
>
The attachment "property" (it's actually a list of elements which is coerced
>
to behave like a property you can set) has to specify its own 'file'
>
property for each attachment element. That's what you set to 'theAttachment'
>
(after all, there can be lots of attachments, you need to be able to specify
>
each one). Like this:
>
tell application "Microsoft Entourage"
>
activate
>
if optionPROPERTIES is "activate attachment" then
>
set theMSG to make new draft window with properties {to
>
recipients:studentMAILTO, subject:studentSUBJECT, content:studentCONTENT,
>
attachment:{file:theAttachment}}
>
else
>
set theMSG to make new draft window with properties {to
>
recipients:studentMAILTO, subject:studentSUBJECT, content:studentCONTENT}
>
end if
>
end tell
>
By the way, why make a draft window on the screen since you seem to have
>
everything you need? Or will you be adding more content manually? If not,
>
make an outgoing message (in the out box, or drafts folder), not a draft
>
window, so you can send it without ever needing to see it open u. It's
>
harder to set recipients of an outgoing message, however, unless there's
>
only one recipient. Write back if you need help with it.
>
--
>
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.
_______________________________________________
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.