This weeks Featured Blog is from our Southestern USA Affiliate – The Scarpetta Group. FileMaker 17 has a new feature which allows you to automatically create directories in a file path if they don’t exist!
In previous versions, you would have to trust users to pre-create the directory, use a plugin or use a system script to ensure that the proper folder was in place in order to export to.
In my scenario, I want to save a PDF of a layout to a folder on my desktop called “PDFS.” As you can see that folder does not exist.
In previous versions, if the folder is not available when you export, you would get this panic-inducing error:
FileMaker 17 allows us to ensure the directory is always there with the “Create Directories” option in the Save/Send As Script Step.
In this script, I set my Export path to the variable “$path” and designate the PDF to go to a folder on the Desktop, called PDFS. In the Save Records as PDF Script Step, note that Create directories is ON.
After I run the script, I now have a folder on my Desktop called PDFS and my file is stored. If the folder exists, FileMaker will simply save the file without overwriting the directory. You are not limited to 1 sub-folder. I have adjusted my path to include a sub-folder for today’s date:
And my result is:
And that’s how you automatically create directories in a file path. Yet another great improvement without having to utilize a plugin!