2 Replies Latest reply on Nov 11, 2008 6:27 AM by tonyleslie

    Script for Multiple emails

    tonyleslie

      Title

      Script for Multiple emails

      Post

      I have created a script that prints out 30 different layouts.  It simply goes to a layout, performs a pre-defined "find" script, prints it out, then moves on to the next layout and does a different "find", and so on until it is done.  It is not a loop.  Each print out is a schedule to be faxed to different sub-contractors.

       

      I would like to change the script to create 30 different emails, with the schedules attached as PDF files.  I would like it to be totally without dialog and have the 30 emails stacked up ready to be sent, or if possible, have them automatically sent as part of the script. 

       

      I am using AOL 9.1 as my email browser.  I can't seem to get to first base with this.  If someone can get me started in the right direction, it would be greatly appreciated.

       

       

        • 1. Re: Script for Multiple emails
          Orlando
            

          Hi Tony

           

          Sound to me like you need to use the 'Send Mail' script step and attach the PDF report to that email. I am not sure how this works with AOL 9.1 however. Is the email browser online or an application on your machine?

           

          The 'Send Mail' script step will use the default email application on your machine to create and save or send an email directly from FileMaker.

           

          The basic steps to this process are:

           

          'Set Variable' with the file path of the PDF you are generating

          'Save record as PDF', to the location specified in the filepath variable

          'Send Mail' setting the option for 'Attach File' and using the variable to locate the file.

           

          And it would look something like this: 

           

           #

           #Create and Send Report 1 

           Go to Layout [Report 1]

           Perform Find [Restore]

           Set Variable [$FilePathReport1] 

           Save Record as PDF [No dialog; "$$FilePathReport1"]

           Send Mail [To:"email@domain.com"; Subject: "Report 1"; "$FilePathReport1"] 

           #

           #Create and Send Report 2 

           

          I hope this is clear enought, let me know if you need any more explanation. 

           

           

           

          • 2. Re: Script for Multiple emails
            tonyleslie
              

            Hi Orlando,

            Thanks for the advice.  I was using the Send Email script slightly differently.  Unfortunately I keep getting the same results.  The script gets hung up in opening the AOL 9.1 email (on my machine).  It won't insert the email address, and it won't automatically attach the PDF.

             

            I will try switching my default email to a Microsoft product to see if that will work.

            Tony