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

Automated import/export from template database...


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

Recommended Posts

Posted

Ok, here's the deal. I have a template database that I work with and when data comes in from my customer I have to duplicate the correct database, rename it to the name of the data supplied, import that data into the database and export a report with the same name, but different extension.

Therefore, the constant here is the name of the file will be applied to the database, imported to the database and exported from the database. I have to do this hundreds of times until the entire folder is done.

I have tried to write applescripts to do this, but it all requires user interaction. I would like to do this seamlessly. Oh to add to the drama, after I export I open the file in BBEdit and convert the carriage returns over to PC then save it in DOS format. How can I make this one applescript, either a folder action or drag and drop?

Posted

Personally, I would not use AppleScript for this, but would attempt to accomplish the whole thing using FileMaker scripting, with the aid of one or more plug-ins.

I'm not clear on why it is that you want a separate file for each data set, if the files (being created from the same template) are identical save for the data they hold. Perhaps you have your reasons, but I would be inclined to bring all the file sets into a single database, with a field which identifies which set they belong to, and script the creation of individual 'subset' filemaker files as exports from the main database if and when they are required.

To automate the process, you could use a plug-in such as Troi File (or perhaps the freeware 'File Toolbox' from Protolight, or any of several other commercially available plug-ins) to:

1. Retrieve a list of the filenames in a designated folder.

2. Import the content of each file in turn, flagging each set to indicate what file they came from

3. Find each set and export the data in a predetemined order to a file on disk

4. Perform a find and replace on the exported file to set up the carriage returns for DOS

5. Rename the export file to reflect the corresponding input file name and move it to an appropriate output directory.

6. Copy or create a clone of the template file and call a sub-script in it to import each set of records from each input batch, renaming each of the resulting fp5 file to reflect the name of the corresponding incoming file.

7. shut down when it has performed the whole procedure for all the files in the source directory

If all this is scripted appropriately in your master file, and set up to point to a designated input directory, then the whole process could be made automatic so that the above procedures run in a start up script.

All you would then do is:

a) move a new batch of files into the folder (ie the one where the script looks for source files)

: launch the main application

c) come back a while later to collect all the ourput files

Of course a fully automated approach might involve FileMaker scripts which also email or ftp the completed file sets to one or more destinations, and possibly also calculate, create and send an invoice for the job - these things can be automated from within FileMaker also - but that's a bit beyond the ambit of the question you asked.

This topic is 8076 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.