5 Replies Latest reply on Apr 9, 2013 12:43 PM by Mike_Mitchell

    Opening PDFs with Unknown Names


      Hi there,

      Here's what I'm trying to do:


      We have jobs that receive multiple invoices which are scanned and named by a third party and all PDFs for all jobs are stored in the same folder. The PDFs are named JobNumber_VendorType_VendorInvoiceNumber.pdf. ex. 3898475_trucking_6456.pdf


      In FileMaker, I would like to create the button "View All Invoices for This Job" or "View All Trucking Invoices for This Job" on the job records. This script would ideally trigger all the PDFs that begin with the job number (3898475 in the example above) to open.


      The vendor invoice numbers would never be entered into FileMaker, so the last section of the filename would be unknown. Is this possible?


      Any ideas would be greatly appreciated!!



        • 1. Re: Opening PDFs with Unknown Names

          Do you know the name / location of the folder?



          • 2. Re: Opening PDFs with Unknown Names

            Hi Mike,

            Yes, the path would be something like  filewin:/D:/JobInvoices/3898475_trucking_????.pdf

            Does that help?


            • 3. Re: Opening PDFs with Unknown Names

              Okay, but the PDFs for each job are not stored in independent folders - they're all stored in the same folder together?

              • 4. Re: Opening PDFs with Unknown Names

                Yes, that's correct.

                • 5. Re: Opening PDFs with Unknown Names

                  Drat. If you had a separate folder for each job, it'd be easy (Import from Folder would do the trick).


                  As it is, you'll probably have to use one of the plugins that allow file manipulation. ScriptMaster from 360Works should be able to do it. You can also use the BaseElements plugin, which is free, and I'm sure there are a couple of others out there that will allow you to manipulate the file system. Troi File comes to mind. Then you can set a variable and pull out all the documents that match the prefix you're looking for and just loop through them.


                  Another option, which may not suit given the workflow, would be to go ahead and pull them into FileMaker using container fields and then you can just use native FileMaker functionality to display them (Export Field Contents / Automatically Open File).






                  Edit: On second thought, Import from Folder probably wouldn't have worked anyway; I think it's restricted to images, now that I think about it (I'd have to double-check).


                  Second edit: It looks like the limitation on importing only images has been removed. According to the Integration Guide, any kind of file can be imported when importing files from a folder. (My curiosity overcame my laziness.)