13 Replies Latest reply on Sep 23, 2011 12:01 PM by BoFeng

    Script about email merge

    BoFeng

      Title

      Script about email merge

      Post

      Email merge needs to write a loop program, which would go over all the records I saved in the database.

      But, how to write the if sentence that specifies the condition like (i <= the maximum record) and then i ++?

      I'm grateful for all the comments.

        • 1. Re: Script about email merge
          philmodjunk

          Instead of the first test, we usually use: Go To record/request/Page [ next ; exit after last]

          That last step exits the loop after the last record in the found set is reached.

          I recognize the syntax for i++ having done a little C programming in my college days,

          Set variable [$I ; Value: $I + 1]

          Is the equivalent, but you may not need this field as you won't need it in the go to next record script step.

          • 2. Re: Script about email merge
            BoFeng

            Hi Phil,

            I appreciate your comments. I'll try then.

            Again, thank you so much.

            • 3. Re: Script about email merge
              BoFeng

              Instead of sending contact one by one, is there a way to send them once?

              Just like list all their email addrs in the mailing recipients?

              Because, syntax like: Send Mail [ ; subject] is a one recipient/time.

              Again, thanks for the assistance.

              • 4. Re: Script about email merge
                philmodjunk

                Send Mail has two basic options for the TO box: an expression you provide which could be a single email or a list, or there's an "email to found set" option that draws together all the email addresses of a specified field for the current found set. There are also ways to build a list of addresses in the BCC box instead of TO.

                • 5. Re: Script about email merge
                  BoFeng

                  Hi Phil,

                  Thank you again.

                  Regarding your comments, "specified field for the current found set." Do I have to create that "specified field"? How the FM locates that "specified field"?

                  Still, is there a tutorial about creating email list?

                  Sorry for the continuous triflling questions.

                  I'm grateful for your assistance.

                  • 6. Re: Script about email merge
                    philmodjunk

                    I suggest you add this step to a script in your database and then open it up and look at the options you can select for it.

                    by "specified field" I mean that you specify a field in your current found set of records or a related table to be used as the source of email addresses. In the set up dialog for send mail, click the black triangles next to each edit box and note the options listed.

                    • 7. Re: Script about email merge
                      BoFeng

                      Hi Phil,

                      I'm grateful for the previous assistance you offered. And sorry for the late reply.

                      As a novice in filemaker, I have two questions that I was still stuck with.

                      1st, how to write the a script to creat a email listserv?

                      2nd, by your suggestion "I suggest you add this step to a script in your database and then open it up and look at the options you can select for it." Could you tell me how to do that?

                       

                      Many thanks to your hard work!

                      • 8. Re: Script about email merge
                        philmodjunk

                        1) I have no idea. You can certainly send out emails to a list serv's email address from FileMaker, but to create a listserv in the first place? I don't think you can, but then I don't know what steps you would go through to set up a listserv...

                        2) If a FileMaker database were a row boat, your two oars would be: Creating properly linked/structured related tables and Writing Scripts. Until you learn both of these concepts, you are limited using your hands to paddle the boat. Wink I recommend that you invest the needed time to learn these two key areas so that you can get the most out of your Filemaker databases. There are a number of training resources--even videos on YouTube that you can use to learn more. (We'll be glad to help you here in the forum, but such training will help fill in the needed "background" and help you better understand and implement any suggestions that we make here.)

                        In this case, you can select Send | Mail from the file menu and see the same dialog box and click on the same buttons. To add this step to a script, you'd open Manage | Scripts, click the new button to start a new script or select an existing script and click Edit to bring up the script editor. Then you can find the Send Mail script step in the list of script steps on the left and double click it to add it to the script. You can then double click this newly added step or click the Specify button to open the dialog box.

                        • 9. Re: Script about email merge
                          BoFeng

                          Hi Phil,

                          Thanks for the suggestions.

                          After learning some basic stuff, I created a little script to perform my thoughts.

                          However, here comes the problem.

                          The script I created was to send emails to my best friends, so I create a field in the database to specify he is or he is not. The script will filter that field. (e.g. if A is my best friend, so the recipient will be only A).

                          However, when I re-execute the script, A will be again appearing on the recipient's list, that is to say A, A.

                          Do you know how to resolve this? I hope I articulate the problem I came across.

                          I'm grateful for your assistance.

                          Bests,

                          • 10. Re: Script about email merge
                            philmodjunk

                            You'll need to provide more detail on how you are doing this. A look at your script would help.

                            To post a script to the forum:

                            1. You can upload a screen shot of your script by clicking the edit link to your original message and uploading it there
                            2. You can upload a screen shot to a file share site and post the download link to a new response you post here.
                            3. You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF.
                            4. If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
                            5. If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional look to your script. (Use the HTML option and paste the text into the HTML editor.)
                            • 11. Re: Script about email merge
                              BoFeng

                              Hi Phil,

                              I appreciate it. The following is the download link for my full script for that:

                              http://www.4shared.com/photo/-uAeZkhH/Capture.html

                              Again, I'm grateful for your kind-hearted assistance.

                              P.S: I do not know why the picture cannot be uploaded directly from my computer. The link above is the one I uploaded to the 4shared.com

                              Sorry for the inconvenience..

                               

                              I copy the script as follows: (hope you can see it)

                              #
                              #Check for Find Mode
                              #
                              If [ Get(WindowMode)=1 ]
                                 Go to Field [ Contact Management::Personal acquaitance ]
                                 Exit Script [ ]
                              End If
                              Commit Records/Requests
                              If [ Contact Management::Personal acquaitance ]
                                 Allow User Abort [ Off ]
                                 Set Variable [ $bus_email; Value:Contact Management::Business Email ]
                                 Set Variable [ $bus_email_sum; Value:$bus_email_sum + $bus_email + "," ]
                              End If
                              Go to Record/Request/Page[ Next; Exit after last ]
                              Send Mail [ Send via E-mail Client; To: $bus_email_sum]
                              If [ Get(LastError) ]
                                 Exit Script [ ]
                              End If
                              Exit Script [ ]

                              • 12. Re: Script about email merge
                                philmodjunk

                                How's that again?

                                I don't see any script. Please check the options I posted earlier on how to do this and try again...

                                • 13. Re: Script about email merge
                                  BoFeng

                                  Hi Phil,

                                  I guess I figure that out. The reason why I have the overlapping recipients name on the emailing list was I used global variable.

                                  I resolved it by changing them to local variables.

                                  By all means, I'm grateful for all your assistances.

                                  Bests,