10 Replies Latest reply on Feb 25, 2009 11:28 AM by jprint714

    Interfacing w/ Mailsmith?

    jprint714

      Title

      Interfacing w/ Mailsmith?

      Post


      I just opened my old FMP database w/ FMP 10, and when I clicked on the email / envelope icon a dialogue box appears and reads: "There was an error addressing the email. Please check that your email software is installed correctly." I know that my Mailsmith software IS installed correctly. So, perhaps I need some sort of patch that makes FMP work w/ Mailsmith? Or is there some change I can (should?) make in the email script that would enable them to work together? Thanks!

        • 1. Re: Interfacing w/ Mailsmith?
          davidhead
             What is the script that the email / envelope icon has attached to it?
          • 2. Re: Interfacing w/ Mailsmith?
            jprint714
              

            Just the Send Mail script that comes w/ FMP.

             

            I went onto the Mailsmith forum, and someone suggested using the following script:

             

            "tell application \"Mailsmith\"¶ 
                 activate¶ 
                 set recipient to {address:\"" & My_Database::email & "\"} ¶ 
                 set subjectText to \"FMP Email test \"¶ 
                 set messageBodyText to \"This is a test message from FMP.\" ¶ 
                 set newMessage to make new message window ¶ 
                 tell newMessage ¶ 
                     make new to_recipient at end with properties recipient ¶ 
                     set subject to subjectText ¶ 
                     set the contents to messageBodyText ¶ 
                 end tell ¶ 

            end tell"  

             

            I expect it would need some adjustments, though I'm not sure one can easily plug it into FMP's New Script editor...  Haven't tried it yet.  What do you think? 






            • 3. Re: Interfacing w/ Mailsmith?
              davidhead
                 So you are using AppleScript! Well that makes a lot of difference. Sorry but I can't help with the AppleScript because it is too many years since I wrote any of that. I will leave it open for others to comment.
              • 4. Re: Interfacing w/ Mailsmith?
                jprint714
                   Actually, I've never used AppleScript before in my life!  That's just what someone in another forum suggested I do.  Do you have another suggestion?  I'd welcome any ideas...  Thank you again!
                • 5. Re: Interfacing w/ Mailsmith?
                  Jade
                    

                  Hi jprint714,

                   

                  Before going down this path, there is one thing you might try.  Ensure that the MailSmith application is open before clicking the email button in FMP.

                   

                  It's very easy to paste the applescript you have into FMP.  In the script editor, select Perform Applescript from the miscellaneous list; click select; choose native applescript and then either paste or type in the script.  

                   

                  If you have FMP 10 Advanced there is some documentation available.  Look in the FileMaker Pro 10Advanced/English Extras/Applescript folder. You should find Apple Events Reference.fp7 which documents the applescript supported by Filemaker.  

                   

                  As for the script, you may need to clean it up by removing the "\" characters.

                   

                   

                  Post back if you have more questions.

                   

                  • 6. Re: Interfacing w/ Mailsmith?
                    jprint714
                      

                    <!-- StartFragment -->

                     

                    Thanks very much for your help.  Yes, my Mailsmith application was on at the time.  But it turns out that it's not anAppleScript script, but one that was designed for FMP.  More precisely, I've been told thatthis is really a FMP "calculation" that returns a string of text inthe format of an Applescript script, which Filemaker then sends to Applescript forexecution.  To that end, I followedthe following steps...

                     

                    1. I go to the layout mode

                    2. I select and right click on the email button

                     

                    Now here's where it gets complicated.  I could either:

                     

                    A

                    (i) select Button Setup

                    (ii) select Perform AppleScript

                    (iii) click on Specify within the "PerformAppleScript" dialogue box there's a "Native

                    AppleScript" or a Calculated AppleScript radiobutton.  I could either...

                    (iv) paste the script in the "Perform AppleScript"dialogue box when the "Native AppleScript" button is selected OR

                    (v) select the "Calculated AppleScript" button,which brings up the "Specify Calculation" dialogue box, and paste thecalculation in this area

                     

                    OR...

                     

                    B

                    (i) select "Select Script Trigger"

                    (ii) under "Specify a script to be run for anevent" check the box that reads "OnObjectEnter"

                    (iii) hit the "Select" button for the "Script"

                    (iv) from there, I could hit the "Edit" buttonunder "Optional script parameter," which brings me to Specify Calculation,and then paste the script from there

                     

                     

                    I've tried scenario A and pasted the following script:

                     

                    "tell application \"Mailsmith\"¶

                        activate¶

                        set recipient to {address:\"" & My_Database::email &"\"} ¶

                        set subjectText to \"FMP Email test \"¶

                        set messageBodyText to \"This is a test message from FMP.\" ¶

                        set newMessage to make new message window ¶

                        tell newMessage ¶

                             make newto_recipient at end with properties recipient ¶

                             set subject tosubjectText ¶

                             set the contentsto messageBodyText ¶

                        end tell ¶

                    end tell"

                     

                     

                    I only changing My_Database to Contact Management (which isthe name of my database). But...when I click on the button I get the following message:"There was an error addressing the email.  Please check that your email software is installedcorrectly."

                    Any suggestions?

                     

                    Thank you again. I appreciate all of your help.

                    <!-- EndFragment -->

                     

                    • 7. Re: Interfacing w/ Mailsmith?
                      Jade
                        

                      Hi,

                        

                      OK, I downloaded a trial copy of Mailsmith and read through your posts with Bruce on the Mailsmith forum.  His detailed explanation is praise worthy ;)

                       

                      This script works on my system with Mailsmith 2.1.5: 

                       

                      "tell application \"Mailsmith\"¶

                      activate¶

                      set recipient to {address:\"" & Contact Management::Email & "\"} ¶

                      set subjectText to \"FMP Email test \"¶

                      set messageBodyText to \"This is a test message from FMP.\" ¶

                      set newMessage to make new message window ¶

                      tell newMessage ¶

                      make new to_recipient at end with properties recipient ¶

                      set subject to subjectText ¶

                      set the contents to messageBodyText ¶

                      end tell ¶

                      end tell"

                       

                      Use your scenario A (v). That is paste it into the "Calculate Applescript" not the "Native Applescript. 

                       

                      Give it a try and let me know please. 

                      • 8. Re: Interfacing w/ Mailsmith?
                        jprint714
                          

                        Thanks so much for your help w/ this...

                         

                        Well, I replaced your script w/ Bruce's script and I'm sad to report that the same dialogue box appears and reads: "There was an error addressing the email. Please check that your email software is installed correctly."  

                         

                        I wonder where I'm tripped up...  Maybe I need to toss some sort of preference or something?  I'd appreciate any suggestions you might have.  Thanks again. 

                        • 9. Re: Interfacing w/ Mailsmith?
                          Jade
                            

                           

                          As Bruce mentioned, his script may have been corrupted by transferring it through email.  I did find some hidden characters in it which I removed.

                           

                          Try making a copy of the script above in my last post (message 8 of 10) including the first and last quotation marks (").  And paste it directly at step A(v).

                           

                          Also, which version of Mailsmith are you using? 

                          • 10. Re: Interfacing w/ Mailsmith?
                            jprint714
                              

                            Ok, I figured it out...I actually didn't select the most inner part of the button.  In answer to your question, I'm using Mailsmith version 2.2 (265)  Also, I just changed the script, and it is as follows:

                             

                            "tell application \"Mailsmith\"¶

                            activate¶

                            set recipient to {address:\"" & Contact Management::Email & "\"} ¶

                            set newMessage to make new message window ¶

                            tell newMessage ¶

                            make new to_recipient at end with properties recipient ¶

                            end tell ¶

                            end tell"

                             

                            The only little thing I'd like to adjust is enabling the cursor to drop into the message body, but that's very minor at this point.   Thank you for all of your help!