6 Replies Latest reply on Apr 21, 2009 1:03 PM by Orlando

    ALmost there... Can't get each file to PDF and then email

    nterroba

      Title

      ALmost there... Can't get each file to PDF and then email

      Post

      Orlando--

       

      I am right there with you and cannot get over the hump.  I can get it to mass email. 

       

      I can get it to create individual PDFs as long as I click the email attachment feature on the PDF creation script. 

       

      But I cannot get the script to address the emails AND attach the pdf to the corresponding email.  PLEASE HELP!

       

      Nelson

        • 1. Re: ALmost there... Can't get each file to PDF and then email
          Orlando
            

          Hi Nelson and welcome to the forum.

           

          I need some more info on what you are trying to do, adn where you have got to so far. Also these two posts that might help if you have not seen them already, let me know 

           

          http://forum-en.filemaker.com/fm/board/message?board.id=FM-en-4&message.id=4387&query.id=80423#M4387

           

          http://forum-en.filemaker.com/fm/board/message?board.id=FM-en-4&message.id=11163&query.id=80423#M11163 

           

          Let me know where you are with it so far, maybe post a copy of you script, and I will see what I can do for you. 

          • 2. Re: ALmost there... Can't get each file to PDF and then email
            nterroba
              

            Orlando--

             

            Thanks so much.  Here is what my script does:

             

            It emails all the people successfully.

            It creates only ONE occasional PDF and attaches it to the email--usually only the first record.

            If I check the "Attach to email" option under the PDF command line, it will create an individual PDF for each record and send them to my email, but will not address them in any way.  Here is the script that I tried to replicate from one of your posts. 

             

            I tried to copy and past the script but it won't paste into here... any tricks on how to do that?

             

            My work email is nelson.terroba@austinisd.org if you reply during the day.   Thanks again.

             

            Nelson

            • 3. Re: ALmost there... Can't get each file to PDF and then email
              Orlando
                

              A good trick to posting scripts is to print it out to PDF and then select the text and copy it, then paste into your post. If your using a Mac just click on Preview in the print dialog,on windows I am not sure of the PDF options.

               

              Otherwise you could just post a screen shot of the script. 

               

              Its hard to know where your script is going wrong without seeing it.

              • 4. Re: ALmost there... Can't get each file to PDF and then email
                nterroba
                  

                Great tip... Here's the script... HELP!

                 

                Set Error Capture [ On ] 

                Go to Layout [ “Layout #1” ] 

                Go to Record/Request/Page 

                [ First ] 

                Loop 

                Set Variable [ $ActiveID; Value:tryout Converted 1::Unique ID ] 

                Set Variable [ $Name; Value:tryout Converted 1::Last Name + tryout Converted 1::First Name ] 

                Set Variable [ $Email; Value:tryout Converted 1::Email ] 

                Go to Layout [ “Layout #3” ] 

                Enter Find Mode [  ] 

                Set Field [ tryout Converted 1::Unique ID ] 

                Perform Find [  ] 

                If [ Get (FoundCount)>0 ] 

                Go to Layout [ “Layout #3” ] 

                Set Variable [ $$FilePath; Value:"filemac:"  &  Get ( TemporaryPath ) & $$ActiveID & "report.pdf" ] 

                Save Records as PDF [ File Name: “filemac:"$FilePath"”; 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 ] 

                Send Mail [ BCC: $Email; Subject: "Report"; Message: "Here is your final confirmation"; Attachment: “file:"$FilePath"” ] 

                [ No dialog ] 

                End If 

                Go to Layout [ “Layout #3” ] 

                Go to Record/Request/Page 

                [ Next; Exit after last ] 

                End Loop 

                 

                • 5. Re: ALmost there... Can't get each file to PDF and then email
                  philmodjunk
                    

                  You seem to be missing a parameter:

                   

                  Change

                   

                  Set Field [ tryout Converted 1::Unique ID ] 

                   

                  to

                   

                  Set Field [ tryout Converted 1::Unique ID , $ActiveID] 

                  • 6. Re: ALmost there... Can't get each file to PDF and then email
                    Orlando
                      

                    PhilModJunk is right, but you also seem to have a few discrepancies with variable names and other errors.

                     

                     

                    Set Variable [ $Name; Value:tryout Converted 1::Last Name + tryout Converted 1::First Name ] 

                     

                    should be

                     

                    Set Variable [ $Name; Value:tryout Converted 1::Last Name & " " & tryout Converted 1::First Name ]  

                     

                     

                    Change 

                     

                    Set Variable [ $$FilePath;

                     

                    to

                     

                    Set Variable [ $FilePath; as you reference it as $FilePath in the Send Mail step.

                     

                    also in that same calculation you call $$ActiveID, this should be $ActiveID 

                     

                    And also you want to change it from "filemac:" to "filewin:" if you are using a Windows PC.

                     

                     

                    and finally 

                     

                    Save Records as PDF [ File Name: “filemac:"$FilePath"”; Current record ]

                     

                    Get rid of the "filemac:" as you specify this in the $FilePath variable.

                     

                     

                    Have a go at updating the script and let us know if it works.