13 Replies Latest reply on Apr 23, 2014 8:53 AM by philmodjunk

    Is finding an external file possible?

    RobMacy

      Title

      Is finding an external file possible?

      Post

           I want to generate a new treatment form with a button.The treatment form is generated in a pdf that is saved in a folder and then I open it up in pdf annotator so that I can record the treatment.  My steps are this:

           1.  find and verify a folder name based on the lastName,firstName of the active record.  Can I do such a find?

           2. if no folder with that name create one.  Can I create an external folder?

           3.save the new treatment form to that folder. Can I save to a pdf to an external folder?

           4. open that new file in pdf annotator(a separate program) . Can I do this with script?

           Im definitely growing my scripting skills on this one. Im primarily wanting to know if its possible to do these things but if you also want to give me a shove in the right direction I wouldn't hate you for it    8)  

            

            

        • 1. Re: Is finding an external file possible?
          philmodjunk

               FileMaker cannot, on its own, search for folder and file names unless they are all located in the Documents Folder--then this is possible by parsing the long list of data returned by Get ( DocumentsPathListing ). But there are several plug ins that you can get that can provide the same ability for files and folders no matter where they are located on your hard drive. A simple web search should pull up a list to research and select from.

               But I am puzzled as to why you would want to record this info in such a complicated in inflexible fashion.

               Why not replicate the PDF form as a FileMaker layout and enter data into blanks on the screen that are fields in a FileMaker table? You can then print or Save as PDF to generate a paper or electronic copy of the completed form whenever this is needed and searching your table for this form will be many times faster and simpler than searching actual PDF files in multiple folders.

          • 2. Re: Is finding an external file possible?
            RobMacy

                 The reason is that the way I use these files once they are created is by making notes via my tablet/pen.  I draw in muscle spasm, pain , ranges of motion etc.  I dont think that filemaker has this functionality, am I wrong?  So you see I want filemaker to create the file(pdf) and then edit it on my tablet.  Do you have ny thoughts on this?

                  

                 Thanks for your quick response btw :)

            • 3. Re: Is finding an external file possible?
              philmodjunk

                   Tablet/pen as in a tablet running windows or the iOS system (iPad)?

                   If running windows on the tablet, there might be a plug in that enables editing a graphic image in a container field. That could make the simpler approach that I suggested possible, but you'd have to do a web search and see what might work for this.

                   As I previously posted, you'll need to acquire a plug in for searching out files and folders and to create new folders.

                   3.save the new treatment form to that folder. Can I save to a pdf to an external folder?

                   You can use Save As PDF and specify any location to which you can construct a valid file path. Here are two links on the subject:

                   Save As PDF in a script: Found Sets to PDF with unique file names

                   More about $Path variables: Exploring the use of a $Path Variable in Scripts

                   4. open that new file in pdf annotator(a separate program) . Can I do this with script?

                   Export Field Contents can be set to export a PDF from a container field and open that copy.

                   If a PDF is inserted with Insert File into a container field with the "store a reference" option enabled, Go to Field in a script or double clicking the container field can open the file.

                   All three methods open the file with the OS specified default application so all three methods would require selecting the correct OS setting to specify PDF Annotator as your default application for opening a PDF. (That's what happens when you double click any file in a computer, the default application opens the double clicked file.)

                   In addition, if you can produce the correct windows command line to use PDF Annotator to open a specified file, FileMaker can execute that command line (or batch file of command lines) to open the file with PDF Anotator. (This option does not require selecting this application as the default application for opening PDF's.)

                   Even with using a PDF in this fashion, I would suggest not putting the PDF files in folders named for the patient. I'd insert the PDF's into container fields in your database where you can then use the database to easily find and access a given PDF file.

              • 4. Re: Is finding an external file possible?
                RobMacy

                     ("As I previously posted, you'll need to acquire a plug in for searching out files and folders and to create new folders.")

                What are these called?

                • 5. Re: Is finding an external file possible?
                  mgores

                       I have done something similar where I have filemaker store a reference to a pdf in a container field.  I have it set up to import the pdf from one folder, then export it to another using file paths determined by fields within that record.  This was done to allow users to take a file that is local on their machine and put a copy of the file in a folder on the server where everyone can access it from the filemaker file.

                       I know I figured it out on here, with help from Phil if I remember right, will look for it and post some more info for you when I can.  You may be able to search my posts and find that thread as well.

                  • 6. Re: Is finding an external file possible?
                    philmodjunk
                         

                    What are these called?

                    They are called "plug ins". wink

                    They are third party produced "add ons" that you can acquire for your installation of FileMaker. You can do a web search for "FileMaker PlugIns" and pull up a list of web sited from the folks that have produced these items and you can explore them to find one that does what you need if such a plug in exists.

                    • 7. Re: Is finding an external file possible?
                      mgores

                           attached is a screen capture of the script I used.  It takes the file someone inserts into a container, exports it to a folder on the server using a filename determined from fields in the file, then reinserts itself from that folder on the server that all users can access.

                           No plugins required.  We have a mixed Mac/PC network so there are "If" steps in there that determine the users platform and perform the appropriate steps.

                      • 8. Re: Is finding an external file possible?
                        philmodjunk

                             Yes Mark, I've posted such a script myself, but it doesn't do what Rob Macy wanted to do. He needs to be able to create PDF files, and also the folders into which he wants to store them.

                        • 9. Re: Is finding an external file possible?
                          RobMacy

                               I do need to search a directory for a folder 

                                 >if its not there > create folder then create file in the new folder and open in pdfAnnotator

                               >if it is there >create file in the new folder and open in pdfAnnotator

                               I understand how to set pdfAnnotator to be the defaul opener of pdfs so thats taken care of

                               I have found 2 plugins that look like they do what I need (though both do ALOT more

                               I would like to learn how to script such a thing

                          • 10. Re: Is finding an external file possible?
                            mgores

                                 I use an applescript that creates a folder.

                                 "do shell script \"mkdir -p -m 777 \" & quoted form of \"/Volumes/yourserver/yourfolder/" & yourtable::foldername & "\""

                                  

                                 yourtable::foldername is a field in your table that determines what you want to call the folder.  If it already exists, nothing happens, if not it is created.

                            • 11. Re: Is finding an external file possible?
                              philmodjunk

                                   Yeah and I use system scripts in Windows such as a batch file, but I think a plug in makes more sense in this situation--especially for one new to database design.

                                   I think not using any such folders and Storing the PDFs in them makes even more sense as a way to keep track of these files.

                              • 12. Re: Is finding an external file possible?
                                RobMacy

                                Thanks for your time on this guys!

                                 Phil your last comment " think not using any such folders and Storing the PDFs in them makes even more sense as a way to keep track of these files"  is confusing to me.

                                • 13. Re: Is finding an external file possible?
                                  philmodjunk

                                       Sorry, for the typo. I meant:

                                       I think not using any such folders and Storing the PDFs in container fields makes even more sense as a way to keep track of these files.