Re: want to see a crashing mail.app and filemaker ?
Re: want to see a crashing mail.app and filemaker ?
- Subject: Re: want to see a crashing mail.app and filemaker ?
- From: Philip Aker <email@hidden>
- Date: Sat, 06 Jul 2002 04:55:39 -0700
On Saturday, July 6, 2002, at 12:16 AM, Jacco Rens wrote:
The following script makes Mail.app and Filemaker crash on my
system, am i doing something wrong here?
Yes. There are things wrong with the script and things that
could be improved with the approach. However, I haven't been
able to get a date out of Mail for the "date received" item so
let's say it's not all your fault.
For the approach, it's good to develop a script incrementally
and use error checking at each step to make sure each line works
before proceeding. I think you will be able to observe the
differences in the portion which deals with Mail (it's very
picky about the referencing for message->mailbox->account). I
opted for an approach which doesn't use globals. It was checked
using the database module of AppleWorks and I just snapped in
the code you had for FMP to illustrate a handler with multiple
input parameters. In AW, I had to open a database file, get the
front document, and then tell that document to make a new record.
tell application "Mail"
activate
set mdate to (current date) as string
try
set mbox to mailbox "INBOX" of account "Personal Mailboxes"
repeat with i from 1 to count of messages of mbox
set msg to message i of mbox
tell msg
set msubject to subject as string
set mbody to content as string
set msender to sender as string
end tell
my storemail(msubject, mdate, msender, mbody)
end repeat
on error errstr number errnum
display dialog errstr & return & "Error number: " & errnum as string
end try
end tell
on storemail(theSubject, theDate, theSender, theBody)
tell application "FileMaker Pro"
activate
try
create new record with data {theDate, theSender, theSubject, theBody}
on error e number n
display dialog e
end try
end tell
end storemail
global mdate
global msubject
global mbody
global msender
set mmailbox to "Filemaker"
tell application "Mail"
set x to count of messages of mailbox mmailbox of account
"personal mailboxes"
repeat with i from 1 to 5
set mdate to date received of message i of mailbox
mmailbox of account "personal mailboxes" as text
set msubject to subject of message i of mailbox
mmailbox of account "personal mailboxes" as text
set mbody to content of message i of mailbox mmailbox
of account "personal mailboxes" as text
set msender to content of message i of mailbox
mmailbox of account "personal mailboxes" as text
tell me to storemail()
set i to i + 1
end repeat
end tell
on storemail()
tell application "FileMaker Pro"
create new record with data {mdate, msender, msubject, mbody}
end tell
end storemail
--
Best,
Jacco Rens
Netherlands
http://www.apple.com/switch
p h i l i p @ v c n . b c . c a
h t t p : / / w w w . a k e r . c a /
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.