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