Please include the option to automatically create (missing) folders when exporting data. When I set the output path to /Users/name/Desktop/a/b/c/myfile.txt I want that a/b/c is created when non existing…
This is such a basic requirement, you are absolutely right to suggest it.
Just this one missing function in FileMaker forces developers to turn to plugin technologies, where a simple extension to existing functionality would suffice.
This gets my vote, and I have added to the list of ideas that help Improve FileMakers Integration Technologies
This seems like it should have happened years ago:-))
Needed that just today.
I don't disagree with this suggestion, but I'd be careful about implementation. Currently, if a file can't be created because the destination folder doesn't exist, the user gets an error:
"Filename.pdf" could not be created on this disk. Use a different name, make more room on the disk, unlock it or use a different disk.
The current message does not include the filepath, which adds to its unhelpfulness in identifying the folder name as the issue.
How far up the folder structure, and how many layers of folders, should the script be permitted to create?
Suppose the target folder is this:
~/Documents/Customer Files/Customer Invoices/North America/United States/Florida/Miami
Presumably we'd want FM to create a new folder if we are creating an invoice for our first customer in Miami and we already have other customers in Florida. Maybe create a Florida folder too if this is our first Florida customer. But how far up should this go? What if there is a typo in the script (e.g. Cusotmer Files), or the user renames the folder high up the line (e.g. "Customer Files - Accounting")?
Our company uses Dropbox Business, and our staff have been added to our Dropbox Business Team. This means that when a computer is connected to the user's Dropbox account, the Dropbox folder created in their User folder is called "Dropbox (Teamname)" instead of just "Dropbox".
Some of our users had individual Dropbox Pro accounts that were converted to Dropbox Business accounts. Their Dropbox folders were created before they were added to our Dropbox Business team, so the folder is still called "Dropbox" instead of "Dropbox (Teamname)". This initially caught me off guard, and many of our scripts that wrote to Dropbox folders showed errors when they tried to export to the original "Dropbox" folder instead of "Dropbox (Teamname)". My workaround has essentially to maintain a value list of which computers do and don't have "(Teamname)" in their Dropbox folder name, and have the filename poll that when generating the export file path. My users often get the error above and are confused by it because it isn't at all clear that it's because the target folder doesn't exist (it's usually because of the Dropbox folder name issue, but sometimes it's because the folder /Florida/Miami doesn't exist)
So changing ~/Documents to ~/Dropbox in the example above, imagine that a script is trying to create this folder which doesn't exist:
~/Dropbox (Teamname)/Customer Files/Customer Invoices/North America/United States/Florida/Miami
Presumably we'd want the script to be able to create the folder and subfolder "/Florida/Miami" if this is the first customer in Florida, but we wouldn't want the script to create a new folder much further up the line, as in the examples described above (Customer Files vs Cusotmer Files, Customer Files vs Customer Files - Accounting, Dropbox vs Dropbox (Teamname)).
This raises a number of questions/decisions about how this would be implemented. For example, in the Export Records script step:
1. The script designer might be given a checkbox option to "Create folder if it doesn't exist" that if selected would automatically create the folder if it doesn't exist when the script step is run.
a. Would this only be permitted to create the lowest-level folder if the parent folder exists, or would it be allowed to create folders and subfolders all the way up the chain?
2. The script designer might be given a checkbox option to "Allow creation of non-existent folder" that if selected would notify the user that the folder doesn't exist and give the user the option to cancel or to create the folder.
a. As in 1a, would this allow subfolders to be created or only the immediate parent folder of the exported file?
b. How would this option be presented to users? Would it be clear that they are creating a new Dropbox folder and all subfolders? Or would it just say "the folder doesn't exist, do you want to create it"?
Presumably FMI could include additional options for how many folder levels to create, but it could run into issues with what characters are permitted in a folder name, the folder path being to long, and any number of other issues that bring it back to square one. Maybe they could allow creation of just the immediate parent, which would be safer, but might not satisfy the needs of many of the people who want this feature.
If Create Folder(s) on Export were implemented, or even just a standalone Create Folder, I'd definitely want a native function FolderExists ( filePath ) to be able to determine if a folder exists, and if not, does its parent folder exist, etc., and be able to warn/inform the user that way and maybe let them open the parent folder to create the target folder. (There appear to be ways of doing this but they're far beyond my ability.)
I envisage something like this:
I could also see a script step that is simply "create directory". In fact, your approach mimics external containers. You can specify a folder, either explicitly or implied by calculation and if it does't exist the OS creates it, so the functionality is kind of already there.
I've not voted, but I think jsciarra has my preference, too. Perhaps better, allow the user to navigate/create the "path" (with scripted filename). The OS permissions should kick in and prohibit some things.
DELIVERED in FM17 :-)
Retrieving data ...