2 Replies Latest reply on Jun 14, 2010 8:34 AM by FentonJones

    Embedding batch of pdfs



      Embedding batch of pdfs


      I am looking for a way to import and embed a batch of pdfs from a folder, each into a container filed in separate records. I can do this manually via" import file", but when I import from a folder the files appear as a pic and are linked back to the folder from which they were imported. As the file they are sourced from will not travel with the application, I need to find a way of automating the importation and embedding of the pdf files. Any clues?

        • 1. Re: Embedding batch of pdfs



          I need to create an app that gives my customers access to PDF's, PPS and some other files which are stored in FM.  My app has hundreds of files so I need a way of copying them into a FM file automatically rather than doing it one-by-one.  Ideally everything in a selected folder should be imported.  (The reason for using FM is to stop them from easily taking copies of the files etc).


          Thanks in advance.





          • 2. Re: Embedding batch of pdfs

            FileMaker does not have native tools to Import files (as files) from a folder. It has the ability to Import 1 file, given an absolute or relative file path. So, what you need is a tool to "list" files in a specified or chosen folder. 


            If you're on a Mac, you'd likely use AppleScript for this. While there a few variations, the simplest command is "list folder". On a PC, you might use the free MooPlug plug-in, with a similar command. Or, if must have a single cross-platform method, you can use 360Works' ScriptMaser plug-in (which takes a lot more code to do it, but comes with examples).


            The basic idea is to get a the file names (or full paths) as lines, into a FileMaker text field (usually global). Then use a counter in a Loop, to pull them out 1 at a time, coerce the path to a FileMaker syntax path, set that into a script Variable, then use that as the path for the Import.


            Two questions then are:

            1. What platform(s)?

            2. Do you know the folder ahead of time, or does the user need to choose it?