MACSCRPT Archives

December 2007

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:
"J.L. Slangen" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Mon, 10 Dec 2007 16:24:34 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
The variable theMessages is set to messages of mailbox X of  
application Mail.
After executing part of an applescript theMessages contains one item.
That one item has two mail attachments.
The following part of the script saves the attachments and tranfers  
them to a folder.

try
repeat with theMessage in theMessages
repeat with theAttachment in theMessage's mail attachments
set theFileName to (folder02_alias as string) & theAttachment's name
try
save theAttachment in theFileName
on error errorMsg number errorNum
display dialog ("Error number " & errorNum as string) & ":  " &  
errorMsg & 	return & "Iets mis met opslaan."
end try
end repeat
end repeat
on error errorMsg number errorNum
display dialog "An error occurred." & return & errorMsg & return &  
"Het foutnummer is: " & (errorNum as string) & " Iets mis met  
naamgeving en verplaatsing."
end try

At this point I get two results: 1) the attachments are saved with  
appropriate names; 2) A message: NSInternalScriptError (8).
Upon inspection of the properties of item 1 of theMessages it turns  
out that the error is associated with 'background color'. As far as I  
know I have nothing done with background color.
How to avoid this error in the scripting support of Mail?

Jef Slangen
[log in to unmask]


vr gr
jls

ATOM RSS1 RSS2