4 Replies Latest reply on Nov 11, 2013 9:31 AM by TSGal

    Scripting Non-PDF email attachments in Filemaker Go



      Scripting Non-PDF email attachments in Filemaker Go


           Hello Everyone-


           I am trying to build a script that attaches an excel file (which is not generated by FMP) to an email both in FMP 12 (in OS Mavericks) and Go (iPad iOS 7). This works just fine when the script executes in Pro.

           However, the file understandably doesn't attach when I execute the script in FMG, as the filepath is completely different. It's unclear how to proceed. 

           The Excel File is a timesheet for employees, and I need to update a particular cell in the file each week. The name of the file doesn't change, but I suppose that the file itself does - I don't know how that affects file path. FWIW, the file is stored in Dropbox, which is installed on both devices.

           I've looked at options involving importing the file into a container field, but this presents two problems as I understand it:

           1) The script doesn't generate a record, persay, of all the information necessary to compose the email with addresses, attachments, etc. and;

           2) I would need to export the file in FM Go in order to create a filepath to then attach, which I'm presently understanding isn't possible.

           If anyone has suggestions about how to proceed, I would greatly appreciate the feedback.

        • 1. Re: Scripting Non-PDF email attachments in Filemaker Go


               Thank you for your post.

               The script step "Save Records as Excel" is unavailable under iOS.  When editing the script, change the pop-up below "Show Compatibility" in the bottom left corner to "iOS", and this will show you all available script steps available.  Notice that "Save Records as Excel" is grayed out.

               Due to Sandboxing under iOS, FileMaker Pro cannot export to a different work area (including Dropbox).  You can only export to the current work area.  Instead, use Get ( DocumentsPath ) to save and access files.

               Since Excel can also import other file types, you may want to consider using comma-delimited or tab-delimited text files.

               Let me know if you need additional clarification.

               FileMaker, Inc.

          • 2. Re: Scripting Non-PDF email attachments in Filemaker Go

                 One possible work around, though I stress that the way the you work with your database may make this an option that doesn't work for you:

                 If you use FileMaker Pro to insert the excel file into a container field, FileMaker GO users should then be able to export that copy from the field and send it as an attachment.

            • 3. Re: Scripting Non-PDF email attachments in Filemaker Go

                   Thanks TSGal-

                   I'm not using the "Save Records as Excel" script step at all; the excel file in question does not contain records exported from FMP. It's simply a file. I do not need FMP to access the content of the file (via exporting or importing).  I only need FMP (and FM Go) to find the file and attach it to an email.


                   I'll tinker around with Get(DocumentsPath) in iOS and see what happens. It's not clear where I would store an excel file in iOS, admittedly, but let's see what FM Go does. Would it work if I stored the file in a container field, then exported it as part of the script only to set the $Filepath?

              • 4. Re: Scripting Non-PDF email attachments in Filemaker Go


                     If you aren't accessing the file from within FileMaker Go, then make sure the Excel file is in the same work area as FileMaker Go.  Otherwise, FileMaker Go would be unable to access it.

                     The suggestion from PhilModJunk is excellent, as the Excel file would be contained in the database file.  Another option is to connect your iOS device to the desktop computer, launch iTunes, and copy the Excel file into the FileMaker Go work area.  From there, you can then email the file.

                     FileMaker, Inc.