July 20, 201312 yr I'm hoping this is possible but trawling through the FMP documentation and forums here hasn't resulted in a solution to what I'd like to do. Essentially I'd like to create a script that can merge the database with another database (where the table structure is guaranteed to be the same). Now that's basically importing from another FMP database several times (since each import can only handle one table). However, I'd like the user to be able to select the file to be imported, and not have the filepath hardcoded into the script. I realise this is possible by storing the filepath as a script parameter, but how can I bring up an "open file" dialog box in a nice way that simply stores the path to the file the user selects, so I can then run the "Import..." script step several times using that path. Also, are there going to be other problems with this method that you can foresee?
July 20, 201312 yr The file to import from is not hosted? In other words they can find it in Finder or Windows Explorer? In that case you use OS-level scripting to capture the file path and name through an OS "open file" dialog. Or you can use the FM "insert" script step to let the user select the file and you insert it into a global container. Then you use "export field contents" to export the file to a location and with a file name that you have control over and use that path & filename in your import variable
July 20, 201312 yr Author The file to import from is not hosted? In other words they can find it in Finder or Windows Explorer? In that case you use OS-level scripting to capture the file path and name through an OS "open file" dialog. Yes, that is correct, and that's what I'd like to do but I need more information on how exactly to do that with "OS-level" scripting. Sounds like it might be too hard for me. Or you can use the FM "insert" script step to let the user select the file and you insert it into a global container. Then you use "export field contents" to export the file to a location and with a file name that you have control over and use that path & filename in your import variableWould that still work if the database is a few hundred MB in size (lots of pictures in container fields)?
July 22, 201312 yr If OS-level scripting is too hard then you can always look at the various file plugins. For approach #2: yes it would still work but it would not be efficient as it requires both an import and an export so there would be a fairly long delay.
Create an account or sign in to comment