File Maker field definition
File Maker field definition
- Subject: File Maker field definition
- From: Brian Loomis <email@hidden>
- Date: Sun, 30 Dec 2001 17:19:16 -0700
Hey folks
As some of you may know, once a Filemaker file gets corrupted, if a recovery
does not work then the next step is to rebuild it by hand, layouts and all.
I am currently helping a new client clean up a system that another Filemaker
developer developed without leaving any development copies. (He always
worked on the live copy)
In the past to rebuild my own databases I have used applescript to pull all
the field names from the database and write them to a text file, then used
Excel to take the text file and import the excel file into filemaker letting
me make new field names off the excel headers. I can also pull the
calculations fields as text too. This works great if the number of fields
in filemaker is less than the total column limitation of excel.
I have gotten to the point where I am setting the field names as a list in
applescript and then as I pull them want to define the new fields in another
open "virgin" database. Here is where I am at: ( the (* and *) are just for
testing other parts)
set xclone to "xMainMenu.fp5"
set xcurrent to "MainMenu.fp5"
tell application "FileMaker Pro"
activate
set xfields to name of fields of layout 0 of database xcurrent
repeat with x from 1 to number of items in xfields
set xField to item x of xfields
show document xclone
create field with properties {name:xField}
(*get properties of field "TodaysDate" of document "MainMenu.fp5"
get formula of field "TodaysDate" of document "MainMenu.fp5"
get best type of field "TodaysDate" of document "MainMenu.fp5"
get class of field "TodaysDate" of document "MainMenu.fp5"
get default type of field "TodaysDate" of document "MainMenu.fp5"
get choices of field "TodaysDate" of document "MainMenu.fp5"*)
end repeat
end tell
And I get the message "objest or property not modifiable. I have looked in
some news groups and done some google searches and am starting to thing that
I can't create a file with AS, maybe am just going to have to define them
and then use AS "get formula" to "cut and paste" the calculations.
Any ideas wise ones?
Brian