Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4140 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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

  • Like 1
Posted

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. :sad:

 

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

Would that still work if the database is a few hundred MB in size (lots of pictures in container fields)?
Posted

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.

This topic is 4140 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.