6 Replies Latest reply on Nov 19, 2012 11:18 AM by philmodjunk

    Save Records as PDF to a Shared Folder



      Save Records as PDF to a Shared Folder



           I have a networked FMP solution using the built in peer to peer model on a Mac network.

           I have a script that Saves Record as a PDF, and then emails said PDF as an attachment. Is it possible to designate an output file path on the computer hosting the database that the client machines also can access?

           At the moment I use:

           $$EMAILRECORDPATH & $fileName

           where $$EMAILRECORDPATH = 

           Get ( DocumentsPath ) & "/Emailed Records/"

           Which is fine if the PDFs are saved to each local machine, but I would like the documents when emailed to be saved to a shared folder on the host machine.

           I have been reading around but cannot seem to find the correct format. All help appreciated!

           Many Thanks in advance,


        • 1. Re: Save Records as PDF to a Shared Folder

               Imagine not using FileMaker to put a file in that shared folder. You drag and drop or copy and paste to put a file from the client computer into that shared folder. There's a file path to that folder and you can use the OS to determine the exact path. In windows, you can right click the folder and select properties to see it.

               If you mount/map the shared folder to all your client machines so that they all use the same file path, or at least a path that can be predicted (Mac and windows systems would have different paths to the same folder.), you can put that path into your variable.

               And just like manually copying the file, the user must have "write" privileges on that shared folder.

          • 2. Re: Save Records as PDF to a Shared Folder


                 Thank you for your reply and help. My understanding is now improved but unfortunately I have not had much success.

                 The client computer can connect to the shared folder on the host with read write privileges and the address is:

                 afp://My MacBook Pro._afpovertcp._tcp.local/PDFSave

                 So the path now in the variable to save the PDF to is:

                 afp://My MacBook Pro._afpovertcp._tcp.local/PDFSave/

                 The save however is not working and I am not sure where I am going wrong with this process.

                 I have mapped the networked drive to the client machine. Perhaps I have the incorrect path?

                 In Get Info the drive is located @ /Volumes/PDFSave

                 Many Thanks for your help, D

            • 3. Re: Save Records as PDF to a Shared Folder

                   OK, I have worked it out. The path is:


                   This works on  the client machine, the next step is to get it working on the host...

              • 4. Re: Save Records as PDF to a Shared Folder

                     Why do you need it working on the host?

                     This can be done, but the path will be different so your script will need to identify whether or not it is being run on the host computer.

                     Get ( MultiUserState ) will return a 1 from the host comuter and a 2 from the client computers.

                • 5. Re: Save Records as PDF to a Shared Folder

                       Thank you.

                       It should work for the host as this is a small office peer to peer network and the host machine will be used as a 'work terminal' as well as hosting the database, mainly a space issue.

                       I have found that in the scipt step to save a record as a PDF and send an email you can define multiple file-paths such as:


                       The first points to the mounted volume, the second to the local HD. If the mounted volume cannot be found the scipt tries the local HD, and this seems to work when the host computer is firing the scipt.
                       I like your suggestion however as it offers a level of control.
                       Thanks again.
                  • 6. Re: Save Records as PDF to a Shared Folder

                         If you possibly can, I suggest not using the Host machine as a way to accesss the database. I realize there's a cost issue in acquiring one more computer, but a dedicated host computer is a far safer way to use your database and there are significant differences--especially in values assigned to global variables, for changes made on the host session versus those made by clients of the hosted database.