Thank you for your post.
Looking at old cases, I noticed that someone did have a problem sending emails with attachments using FileMaker Pro 9 when the script steps "Save/Send Records As PDF..." and "Send Mail" were inside a loop. This caused FileMaker Pro to lock up after 20-30 loops, so your situation could be related. I could not find any reference to Mail being hidden. That doesn't mean it isn't a contributing factor.
Are you sending the mails manually? That is, are you pulling down the File menu and selecting "Send Mail..."? Or, is this being done within a script? If a script, can you provide the script steps? Anything else you can provide may be helpful to finding the cause.
is there a quick and easy way to copy the script steps and paste them here? I cannot seem to do it.
There is no copy/paste option for script steps. You can either type them in, or print the script by pressing the printer icon in the Manage Script dialog box, select current record, and selecting PDF. Then, open the PDF file to copy and paste.
Yes, I use a script to automate the PDF attachment to the email. It does not automatically send the mail as there are times the email needs to be modified before being sent. So the final "send" process is the done be the user.
Here are the script steps:
Allow User Abort [ On ]
Set Field [ SR•real_ID::report name; "Confirm.pdf" ]
Show Custom Dialog [ Title: "Report name"; Message: "What is the name of this report?"; Buttons: “Continue”, “Cancel”; Input #1:
SR•real_ID::report name, "Report name:" ]
If [ Get( LastMessageChoice ) = 1 ]
Set Variable [ $$document_path; Value:Let(
file_name = Substitute ( SR•real_ID::report name ; ".pdf" ; "" ) & ".pdf";
docs_path = Get( DocumentsPath );
full_path = docs_path & file_name;
mac_path = "/Volumes" & Right( full_path; Length( full_path ) - 1 ) & "\""
Go to Related Record [ From table: “SR•real_ID”; Using layout: “Confirmation” (SR•real_ID) ]
[ New window ]
Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ]
[ Restore; No dialog ]
Save Records as PDF [ File Name: “filemac:$$document_path”; Current record ]
[ Document - Compatibility: Acrobat 5 and later ]
[ Pages - Number Pages From: 1; Include: All pages ]
[ Security - Printing: High Resolution; Editing: Any except extracting pages; Enable copying; Enable Screen Reader ]
[ Initial View - Show: Pages Panel and Page; Page Layout: Single Page; Magnification: 100% ]
[ Restore; No dialog ]
Close Window [ Current Window ]
Send Mail [ Send via E-mail Client; To: SR•real_ID::email_to; Subject: "Confirmation"; Message: "Attached is your confirmation.
¶¶Please do not email changes within 48 hours of the service. Call us at 410 321 5600. ¶¶ We hope that you enjoy your
service!¶¶"; Attachment: “filewin:$$document_path” OR “filemac:$$document_path” ]
If [ Get( LastMessageChoice ) = 2 ]
Go to Layout [ “SR Menu” (SR•real_ID) ]
Your script steps look fine. I have set up something similar, and I have run the script 50 times to a generic email account, and I have yet to make it crash. I know that doesn't help you, so let me find out a little more information...
Is this script being called from another script? A button?
Does the report name contains any non-alphanumeric characters?
Do you have access to a OS X 10.5.x machine? If so, can you try it there with an updated version of Mail? Does this work?
Some nit-picky things....
1. In your Save Records as PDF script step, you specify "filemac", but in the Attachment, you specify "filewin" and "filemac". Is this intentional? It doesn't make any difference, but it did catch my attention.
2. Near the bottom of the script, you evaluate LastMessageChoice...
If [ Get ( LastMessageChoice ) = 2 ]
If you evaluate this first, and since this contains a Halt script, then you wouldn't need to evaluate for LastMessageChoice = 1, because if it bypasses 2, you know it must be 1. Does that make sense?
3. In your Set Variable [ $$document_path....
You set "mac_path", but you never use it or pass it back. Is this intentional?
Please continue to keep me updated.
Thanks for the pointers. I did not notice this and cleaned it up.. hoping that it would work. I tried tweeking the script process as well to be sure that this was the very last thing that the whole script does. However, we are still getting this problem. Since this only happens with Filemaker, I am assuming it has something to do with the attachment coming from Filemaker. I don't know if this helps but here is part of the crash report:
2009-05-26 15:58:35.321 Mail failed to get body for message <LibraryMessage: 0x5b8e2f0, library id: 86366>
2009-05-26 15:58:35.323 Mail failed to get body for message <LibraryMessage: 0x5b4f040, library id: 86365>
2009-05-26 15:58:35.324 Mail failed to get body for message <LibraryMessage: 0x5b77fc0, library id: 86364>
2009-05-26 15:58:35.326 Mail failed to get body for message <LibraryMessage: 0x5b80400, library id: 86363>
2009-05-26 15:58:35.329 Mail failed to get body for message <LibraryMessage: 0x5b8d700, library id: 86362>
2009-05-26 16:02:06.038 Mail *** -[NSCFArray objectForKey:]: selector not recognized [self = 0x5c05b00]
2009-05-26 16:02:06.038 Mail Exception raised during posting of notification. Ignored. exception: *** -[NSCFArray objectForKey:]: selector not recognized [self = 0x5c05b00]
May 26 16:02:54 Admiral-2 crashdump: Mail crashed
May 26 16:02:56 Admiral-2 crashdump: crash report written to: /Users/mark/Library/Logs/CrashReporter/Mail.crash.log
Is there another way to do this, perhaps?
I apologize for the late reply.
Thanks for sending the crash report. As you can see, the crash information is coming from Mail. Do you know what record FileMaker was able to send successfully? There may be something in the NEXT record that is causing the problem. Find this one record and try executing the script to see if it fails. I don't expect it to fail, but I'm hoping this may provide some insight into a possible cause.