Thank you for your post.
You may want to create a couple of global fields. This way, the user can enter the filename into one field, and the path into a second field. Then, store both into a variable and use that as part of the Import Records script step. For example:
Set Variable [ $file ; If ( Abs ( Get ( SystemPlatform) ) = 1 ; "filemac:" ; "filewin:" ) & <global field for path> & <global field for filename> ]
Import Records [ no dialog ; $file ; <specify field order> ]
Go to Layout [ <layout you want to show after importing> ]
You can also specify a layout by a calculation.
Let me know if you need clarification for any of the above steps.
Is there not a way to let the User browse to their directory/file to select it, as in Explorer? Then capture that path and selected file name. That's what would be available in any other programming software, or do we have to add this to a FMP wish list?
You can set up a script that pops up the open file dialog for the user to select a file from which to import. Just clear the data source option and don't select the perform without dialog option.
In File Maker, copying and pasting scripts are not quite easy as scripts never behave like texts, that can be copied and pasted in Filemaker script editor. If there are some modifications in some of the scripts in a file, then it is not needed to copy and replace the whole file in the client's live application, Modification should be done for that particular script. It happens that if some logic or new functionality is required to be implemented, then there is a need to create the scripts at the developer's end and QAing will done for that new modification, then that script again needs to be written in the Client's live application. Because of live data, the script written in the client's end can not be checked. As the script is written directly and not tested then that script may have some defects. Those defects will appear at the time of work for that functionality in live, which is a big problem. To prevent this kind of situation, "Import Script" option can be used.