Jump to content
Server Maintenance This Week. ×

Importing multiple files with one script.


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

Recommended Posts

I would search but I don't know what to searth for. If anyone can tell me where to look I would be most appreciative.

I have a database of about 5 FM files with generate webpages. Called Sections, Pages, Images, Links, and Thumbnails. It works great. This database generates all the webpages for a website, maintains all the links, etc...

However, I have a bunch of different websites. I have one database, a folder with the five files, for each website. The problem arises when I write or modify a script, define a field, or change a layout. I want this change to take place on all of my website databases.

Does anyone know of an easy way to deal with this situation? I know the brute force way.

1) Duplicate the most up-to-date database.

2) Save all 5 files as clones

3) Duplicate the clone folder.

4) Import the records from each of the old database files into each of the clones of the duplicate folder.

5) Go to the next website and return to step 3, until I have done all the websites.

Obviously the excitement of that wears off quickly.

I figure this problem isn't uncommon and someone has probably already solved it. Please let me know.

Basically I want to be able to take the layouts, field definitions, and scripts from one group of FM files and and the records from another group of files, and put them together, by waving a wand.

One of the few weaknesses of FileMaker is how records are tied to layouts, field definitions, and scripts. Data shouldn't be hardwired to code. Comp Sci 101 smile.gif" border="0

Link to comment
Share on other sites

I'd be tempted to redesign the entire system.

e.g.

One "master" file, say, sites.fp5, which would store "global" parameters for each web site as well as a primary relationship key for each web site

Your content files, i.e. Sections, Pages, Images, Links, and Thumbnails, which would store the appropriate data for all of the web sites as well as the foreign relationship key for the site in sites.fp5

If you have the time and ability, this is probably the best route to take for long-term sanity.

Link to comment
Share on other sites

  • 2 weeks later...

I had thought of something similar, but your Master File concept is simpler than what I had envisioned. Thanks. I will consider it.

In the meantime, I have implemented a system which works but is a bit fragile, I am afraid.

In each of the five files I have put 3 scripts.

1) Clone Me To the Output Folder

2) Export My Records to the Data Folder

3) Import All Records from the Data Folder

Then I have a Controller.fp5 file whose job is simply to call external scripts.

To give database B all the layouts, fields and scripts of database A.

Controller.fp2

1) calls Clone Me on all five files of A

2) calls Exports Me on all five files of B

3) calls Import on all five files of Output.

(I use Troi File plug-in for various file/folder existence checks etc)

Then in the Output folder is the database which has the records of B but the layouts, field def's and scripts of A

Link to comment
Share on other sites

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