Re: Help with Entourage & attachments
Re: Help with Entourage & attachments
- Subject: Re: Help with Entourage & attachments
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 22 May 2003 06:55:56 -0700
On 5/22/03 4:33 AM, "julifos" <email@hidden> wrote:
>
Unfortunatelly, same results... At this point, I would be interested if
>
somebody can replicate this behaviour using this code... (expected results:
>
Entourage crashing)
>
>
#####################################
>
set x to (choose file with prompt "Choose attachment...")
>
>
tell application "Microsoft Entourage"
>
set testMsg to (make new outgoing message at out box folder with
>
properties {subject:"test"})
>
make new attachment at testMsg with properties {file:x}
>
properties of result
>
end tell
>
#####################################
Yes. I confirm it. But only in this context. That's the ONLY type that
crashes.
Run this:
tell application "Microsoft Entourage"
set testMsg to item 1 of (get current messages)
set testAttach to attachment 1 of testMsg
properties of result
end tell
first on a received message with an attachment (no problem), then on a sent
message with an attachment (no problem), then on an unsent draft message
which you've made in the UI and attached a file in the UI.
So the problem is only with a brand new unsent message created by
AppleScript. I get 'stop' as well, which is not listed in the enumerations
for 'encoding' in the dictionary and does, as you say, compile outside any
tell block (therefore won't show up in raw code in Smile's 'copy
translate'.) When I check the encoding property in the properties result
from all my messages that don't crash, the encoding is 'no encoding' or
AppleDouble or base64 or whatever.
When I do this:
set x to (choose file with prompt "Choose attachment...")
tell application "Microsoft Entourage"
set testMsg to (make new outgoing message at out box folder with
properties {subject:"test"})
make new attachment at testMsg with properties {file:x,
encoding:AppleDouble}
encoding of result
end tell
'encoding' is _still_ 'stop', not AppleDouble, and 'properties' still
crashes.
Therefore I think that the attachment is not properly encoded. You'll notice
that if you add an attachment to a draft window in the UI, then save to make
it a message (or save as message first, then add attachment, then re-save)
you get a dialog "Encoding attachment..."). That step is skipped when making
an outgoing message by script. The attachment gets encoded when the message
is sent and all is well.
I can report this as a bug, but I can't imagine it will get a very high
priority. I can't think of any circumstance in real life where you would
make a message by script, not send it, then try to get the properties of an
attachment of this unsent draft message. This is just geekdom. The
attachments will get encoded as soon as you send them, which is all that
anyone usually cares about.
If you can get a replicable case of the crashing when checking attachments
of received or sent messages, I'd think it would get higher prioritization.
>
>
When I run this code from an applet, I also receive an error message
>
"Connection is invalid".
That message is from the scripting system after Entourage crashes. It means
the connection to 'application "Microsoft Entourage", from which it's still
waiting a reply, is invalid because it no longer exists.
--
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.