3 Replies Latest reply on Feb 13, 2012 8:39 PM by philmodjunk

    Script to send an email with the "find" results attached

    dumiya

      Title

      Script to send an email with the "find" results attached

      Post

      This a print of the personalised script Ref: TSGal  June 17,2011

      I have tried to follow the Script given in the above reply: The creating an email works but there is no attachment.

      I have a Master shopping list,   I select items, find only the selected items. Now I want to send that list to my iPhone using a script. 


      Set Variable [ $FileName; Value:"Shopping List.pdf" ]

      Save Records as PDF [ File Name: “$FileName”; Records being browsed ]

      [ No dialog ] ((-This is out of place in the print out))

      Set Variable [ $PDFPath; Value:Get(DocumentsPath) & $FileName ]

      Send Mail [ Send via E-mail Client; To: "xx@xx.xxx"; Subject: "Shopping List";

      Message: "$PDFPath" ]

       

      The Script will not accept "Test";"$PDFPath" Its says it is looking for an operator after the ";". 

      The script does generate an email but no attachment , so I am half way there!  The above is a print out of my script word for word except the email address. I would be grateful for any help. (iMac27 FM11 FMGo latest version)

      dumiya

        • 1. Re: Script to send an email with the "find" results attached
          philmodjunk

          Where are you trying to enter "Test" ; "$PDFPath"?

          That doesn't fit with any of the script steps in the script you posted.

          If this is the send mail step. Double click the step to open the Send Mail dialog. Then click the "attach file" check box and enter the variable name (don't use quotes) directly in the specify file dialog.

          • 2. Re: Script to send an email with the "find" results attached
            dumiya

            Thank you for the reply. I have re done the script as suggested but  the PDF file is not attaching to the email.

             

            Copy of the Script as in the Script window-

             

            Set Variable [$FileName; Value:"Shopping List.pdf"]

            Save Records as PDF [No dialogue; "$FileName"; Records being browsed]

            Set Variable [$PDFPath; Value:Get(DocumentsPath) & $FileName]

            Send Mail [Send via E-mail Client; To: "XXX@XX.XXX"; Subject: "Shopping List"; Message: $PDFPath]

             

            This creates the email but with no attachment

            The email message reads  - /dumiya/Documents/Shopping List.pdf

            This is a reference but not the file.

            Eventually the file will be in the iPad 2 and the  'found records list' sent to the iPhone.

            **edit added** I have found the script does create a  - Shopping List.pdf - on the iMac desk top.

            Attached (i hope) is the Script step window

            • 3. Re: Script to send an email with the "find" results attached
              philmodjunk

              I see two problems here:

              1) You use Save as PDF with a variable that specifies the filename but not the file path.

              Your script should be:

              Set Variable [$FileName; Value:"Shopping List.pdf"]

              Set Variable [$PDFPath; Value:Get(DocumentsPath) & $FileName]

              Save Records as PDF [No dialogue; "$PDFPath"; Records being browsed]

              Send Mail [...

              This saves the PDF to the documents folder and thus $PDFPath stores the actual path to where the PDF is created.

              Then, to repeat info from my last post, you do not put the variable in the message box. Instead, click the attach file check box and type $PDFPath into the specify file window that opens when you click this check box. You enter whatever text you want as the body of your email in the message box.