3 Replies Latest reply on Nov 20, 2009 8:20 AM by philmodjunk

    Edit layout through a script


      Edit layout through a script


      Is there a way to modify a layout design using a script? (v8, pc) I have recently taken over a database and would like to update a couple of layouts, however there are nearly 40 users each running the database on their own computer, (database structure is the same, however records are specific to the user). Some users are not very computer/database savvy and rather than write out the lengthy process for making the changes, I was hoping to write a script to take care of most of the steps. I am rather new to FMP and the best idea I have come up with is to send them a database file with just the layouts they will need to copy into their database. With both databases open rename layouts they will be replacing, (pre-caution to not lose existing prior to making sure updates are successful), create new layouts named the name of the layout they are replacing and then copy and pasting new layout from database file I send them. I am very open to any other ideas!!


      Thanks in advance!

        • 1. Re: Edit layout through a script

          Scripts cannot modify or create layouts.


          You could create a new updated copy of your file and create a script in the file that systematically imports all data from the current copy of the file and updates any serial number setttings. You can then send out a clone (file with no records present) of this file to all users with instructions to click a button to import all their data from the old file into the new.

          • 2. Re: Edit layout through a script
               Shucks! Unfortunately, I inherited this database and it is a mess. There are 64 tables and 101 relationships...just to start with. I still haven't worked through the whole design report and determined what all is happening within the database. (There are some poorly written scripts, broken links, etc.) It looks like trying to import the data correctly is going to be quite an undertaking. The modified layouts affect just a minor portion of the whole database, yet necessary for an annual data updating process.
            • 3. Re: Edit layout through a script
                 Your other option is to split your database into two files. File 1 contains all your layouts, scripts, value lists and such. File 2 contains all the tables--and can for the moment simply be your current copy of the file. In file 1, you start with a copy of the original file and then take each table occurrence in your relationship graph and point it at a table in the original file. Then you can update the layouts and distribute this copy to your customers with instructions to place it next to the original file. The main draw back here is that there is nothing to stop your users from accidentally opening and using the original file that is now serving as your "back end".