Title: Re: Make new event from this message script; opens wrong message
On or near 10/14/01 11:24 PM, Timothy Bates at [EMAIL PROTECTED] observed:

> Hi there,
>
> If I select a message in a view, then run the make event from this message
> mail script, a new event is created, but with a different e-mail for its
> contents (always the same e-mail (an outgoing mail in my drafts box), no
> matter which message I select).
>
Since that is a script supplied by Microsoft, this is a strange problem. Here is the script as I have it; is yours the same?

tell application "Microsoft Entourage"
    
    -- get the currently selected message or messages
    set selectedMessages to current messages
    
    -- if there are no messages selected, warn the user and then quit
    if selectedMessages is {} then
        display dialog "Please select a message first and then run this script." with icon 1
        return
    end if
    
    repeat with theMessage in selectedMessages
        
        -- get the information from the message, and store it in variables
        set theName to subject of theMessage
        set theCategory to category of theMessage
        set theContent to content of theMessage
        
        -- create a new note with the information from the message
        set newEvent to make new event with properties {subject:theName, category:theCategory, content:theContent}
        
        -- create a link between the message and the new note
        link theMessage to newEvent
        
        -- if there was only one message selected, then open that new note
        if (count of selectedMessages) = 1 then open newEvent
    end repeat
end tell

As you can see, it uses “current messages” to get the list of selected messages. I don’t know of any way that could end up pointing to some unsent message in your Drafts folder. If your script is identical to the above, you might try running a test script in Script Editor. Open the Result window (cmd-L). Then, in a new script window, just type:

tell application "Microsoft Entourage"
    
    -- get the currently selected message or messages
    set selectedMessages to current messages
    set theMsg to item 1 of selectedMessages
    set theSub to subjecct of theMsg
end tell

In Entourage, select the message you want to make a task for. Then, in SE, run the script. See what the results are in the Result window. Should be the subject of that one message. If not, you have a very peculiar problem—perhaps database corruption.
--
Add me to Palm/Visor: http://signature.coola.com/?[EMAIL PROTECTED]
Allen Watson <[EMAIL PROTECTED]> XNS name: =Allen Watson
A Mac family since 1984 <http://home.earthlink.net/~allenwatson/>
Applescripts for Outlook Express and Entourage: <http://homepage.mac.com/allenwatson/>

Reply via email to