Sorry for the slow reply. I didn't reallize I'd gotten any response til now.
To recap:
>>My problem is now the code (that creates the subject) doesn't seem to work.
I'm wondering if Entourage needs a delay before I ask it to grab the
attachment's file name.
>>
>> Here's the code:
>>
>> Thanks in advance.
>>
>> on open ThisItem
>> tell application "Microsoft Entourage"
>> open ThisItem
>> activate
>> with timeout of 600 seconds
>> set theAccount to default mail account
>> --set theSource to source of theMsg
>> set newMsg to make new outgoing message at drafts folder with
>> properties {account:theAccount} --, source:theSource
>> set {window 1's to recipients, window 1's CC recipients} to
>> {"[EMAIL PROTECTED]" & "," & "[EMAIL PROTECTED]" & "," &
>> "[EMAIL PROTECTED]", "[EMAIL PROTECTED]" & "," & "[EMAIL
>> PROTECTED]"}
>> end timeout
>> end tell
>> tell window 1
>> try
>> set attName to name of attachment
>> set subject to my (attName)
>> end try
>> end tell
>> end open
>
> One problem is that you are attempting to set the subject of window 1.
> Normally, windows do not have subjects - see the dictionary. IF window is a
> message window (window of a saved message) or a draft window (where you're
> making a new unsaved message) then you can change the subject of the
> displayed message or of the draft window. So if this is a draft window, it
> should be possible.
> But earlier in the script, you are making a new outgoing message at the
> drafts folder, NOT a new draft WINDOW. Nor do you open this new message into
> its own window. So where exactly is 'window 1' coming from? Is this some
> other open message or draft window?
The script IS creating a new window (which I want it to). I don't know why,
when originally writing the code, I had it "tell window 1," but I didn't
know how to indicate which message I wanted to work on (set newMsg with
subject "X"?)
> Could you please explain what you're actually trying to do? In
> particular, is window 1 supposed to be the outgoing message you just made,
> or some other window?
The script is a droplet onto which I can drag files which will be added to a
new message, with certain recipients, as attachments. I can get this much of
the script to work.
I have another script which I use which solely sets the subject of the open
window as the file name of the attachment
I just appended its code to my droplet script:
tell window 1
try
set attName to name of attachment
set subject to my (attName)
end try
end tell
> Finally, attachment are (generally) _elements_, not properties, of messages
> an draft windows. So you'd need to get the name of, say. attachment 1, not
> 'attachment'.
I should've mentioned that I CAN successfully run the 10 lines of code when
they are in a separate script (run after running the droplet script).
--
To unsubscribe:
<mailto:[EMAIL PROTECTED]>
archives:
<http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive:
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>