Help~ About applescript on (OSX 10.3.9)

Discussion in 'Mac Programming' started by byf1987, Aug 1, 2006.

  1. byf1987 macrumors newbie

    Aug 1, 2006
    Hi everyone, I am new to here...

    Can anyone help explaining this:

    I use the following code in my applescript for, it's supposed to be run under certain rule:

    using terms from application "Mail"
    on perform mail action with messages theMessages
    tell application "Mail"
    display dialog "On perform mail action"
    my saveAttachments(theMessages)
    end tell
    end perform mail action with messages
    end using terms from

    and I have another "on run" block which is for debugging purpose:

    on run
    tell application "Mail"
    display dialog "On run"
    set theSelection to selection
    my saveAttachments(theSelection)
    end tell
    end run

    the "saveAtachments" works fine with "on run" (run from script editor) but does not work with "on perform mail action"...

    After debugging for some whole days, I found that the following code displays the raw source for the message when running with "on run", but displays something other than the raw source for "on perform mail action".

    repeat with eachMessage in messageList
    -- messageList is the parameter passed into "saveAttachment"
    display dialog source of eachMessage as text
    end repeat

    Can someone explain why, thanks a million in advance!

    Btw, I am new to code is from here:

    Btw2, the raw source I want starts with "Return-path: ...". This is what is displayed in's view of raw source.

    Btw3, the on my PC is 1.3.11 (v622/624)

    Thank you all the same for your time if you are just viewing~
  2. byf1987 thread starter macrumors newbie

    Aug 1, 2006
    Maybe I can address the problem this way:

    When an email is newly received in, we can only get part of its header info by using "get source" or "get all headers" in the applescript.

    How if I want to get the full header?

    Thanks in advance again...
  3. byf1987 thread starter macrumors newbie

    Aug 1, 2006
    #3 replies available before I figured it out myself...

    The solution...use POP account.

    This thread can be closed...thanks for those who paid attention...

Share This Page