MACSCRPT Archives

January 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Nigel Garvey <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Sat, 7 Jan 2006 14:36:38 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (79 lines)
Marc Bossiere wrote on Fri, 6 Jan 2006 11:07:43 -0700:

>Does anyone have a handy script for exporting delimited email messages from
>Clais Emailer 2.0? I have one that moves mail from Outlook 5.0 to a
>Hypercard stack, but I can't seem to modify it to work with Emailer.

I don't know what you mean by "delimited" messages, but these are the
Emailer equivalents for your "Outlook Express" lines:

>tell application "Outlook Express"
>    set countExpInbox to "0"
>    set countExpSentmail to "0"
>    set countSizeExceeded to "0"
>   =20
>    set myMessages to every message in folder "Inbox"
>    repeat with currentMsg in myMessages
>        --set popAcct to name of account of currentMsg
>        set popAcct to "pobox.com" as string
>        set senderAddr to address of sender of currentMsg
>        set msgSubject to subject of currentMsg
>        set senderName to display name of sender of currentMsg
>        set msgContent to content of currentMsg
>        set timeSent to time sent of currentMsg

  tell application "Claris Emailer"
    set countExpInbox to 0
    set countExpSentmail to 0
    set countSizeExceeded to 0
    
    set myMessages to every incoming message in in box folder
    repeat with currentMsg in myMessages
      set popAcct to name of account of currentMsg
      -- You have to get the sender first, then get the address and
      -- display name from the result; but this works too.
      set {address:senderAddr, display name:senderName} to sender of
currentMsg
      set msgSubject to subject of currentMsg
      set msgContent to content of currentMsg
      set timeSent to time sent of currentMsg

>        if failedFlag is true then
>            move currentMsg to folder "HC-Exceeded 30K (Inbox)"
>            set countSizeExceeded to (countSizeExceeded + 1)
>        else
>            move currentMsg to folder "HC-Exported (Inbox)"
>            set countExpInbox to (countExpInbox + 1)
>        end if
>    end repeat

The above lines work in Emailer too, provided that the folders are top-
level ones. Otherwise it's 'folder "HC-Exported (Inbox)" of folder ...' etc.

>    set myMessages to every message in folder "Sent Items"
>    repeat with currentMsg in myMessages
>        set popAcct to "pobox.com" as string
>        set recipAddr to address of recipient 1 of currentMsg
>        set msgSubject to subject of currentMsg
>        set senderName to display name of sender of currentMsg
>        set msgContent to content of currentMsg
>        set timeSent to time sent of currentMsg

  set myMessages to every outgoing message in sent mail folder
    repeat with currentMsg in myMessages
      set popAcct to name of account of currentMsg
      set {address:recipAddr, display name:recipName} to address of
outgoing recipient 1 of currentMsg
      set msgSubject to subject of currentMsg
      -- Did you mean the recipient name here?
      set senderName to display name of (get sender of currentMsg)
      set msgContent to content of currentMsg
      set timeSent to time sent of currentMsg

Just to confirm: whereas the 'sender' is a property of a message,
containing the 'address' and 'display name', a 'recipient' is an element.
Each recipient has an 'address' property containing the 'address' and
'display name'.

NG

ATOM RSS1 RSS2