4 Replies Latest reply on Sep 23, 2010 9:45 AM by WalterK

    Send multiple attachments in email script?

    CarrieB.

      Title

      Send multiple attachments in email script?

      Post

      I've basically modified the Email Campaign template and want to know if there is any way to add multiple attachments to an email? I see that it hasn't been available in the past. Has anything changed in FileMaker Pro 10? I've tried modifying the script a million different ways with multiple attachment containers, but nothing seems to work. It would be extremely nice to be able to attach 2 files without the end user having to do anything.

       

      Thanks!

       

      Carrie

        • 1. Re: Send multiple attachments in email script?
          TSGal

          CarrieB.

           

          Thank you for your post.

           

          Currently, FileMaker Pro will only attach one file.  If you have the ability to zip files together, then you can attach the zip file.

           

          I would urge you to enter this information into our Feature Request web form at:

           

          http://www.filemaker.com/company/feature_request.html

           

          I know I could easily copy your post and paste it into the form, but there are additional questions asked that only you can answer.

           

          When entering the suggestion, please don't say "Add this feature".  Instead, explain what you are trying to do, what is stopping you, how is this hurting your productivity, etc.  In other words, sell your idea.  From past experience, I have noticed that more attention is given to those requests that have real-life examples.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Send multiple attachments in email script?
            CarrieB.
              

            Thank you. I will go request that feature. I have already combined the files into one PDF, but I would still prefer them to be separate.

             

            Thanks again!

            • 3. Re: Send multiple attachments in email script?
              hiatts
                

              Yes there is an easy'ish way...

               

              On a mac... 

               

              1. Set a variable to the temporary storage location: Get(TemporaryPath) + a file filename, ie ...temppath.../ladidah.xls

               

              2. you use save/send as and or export found set commands, and save all the files you want to this variable (the temp path), save records as, or export, and use the variable from 1.

               

              3. Use AppleScript to create the mail, and attach the files, calling from FMP with Perform AppleScript.

               

              "tell application \"Mail\"" & ¶  & 

               

              "set theMessage to make new outgoing message with properties {visible:true, subject:\"" &  $EmailSubject & "\", content:\"Please find attached the result of your processed RMA request.\" & return & return }" & ¶  & 


              "tell content of theMessage to make new attachment with properties {file name:\"" & $FileNamePDF & "\"} at after last paragraph" & ¶  & 


                       "tell content of theMessage to make new attachment with properties {file name:\"" & $FileNameXLS & "\"} at after last paragraph" & ¶  &


                       "tell theMessage"&  ¶  &

                             "make new to recipient at end of to recipients with properties {address:\”" & $Address & "\"}" & ¶  &

                        "end tell" & ¶  &

               

              $Activate & ¶  & 


                       $SendTheMessage & ¶  & 


              "end tell" 

               

              DONE!

               

              Note I only attach two files, however you can loop this in AppleScript, by passing in either a string of filenames and a path, or even referring to a table with the filenames to attach.

               

              Good luck 

              • 4. Re: Send multiple attachments in email script?
                WalterK

                Can you please dbl-check your AppleScript text? getting an error on the very first line.