HyperCard: Converting HyperCard Data to FileMaker (2/93)

The following HyperCard script is a general approach to converting stack
data to FileMaker format. To use it, create a new button on any card, then
enter the text below into the script area of the button. When you are done
entering the script, click the new button to begin the export process.

on mouseUp
put the short name of this stack & ".txt" into fileName
ask "Send text to what file?" with fileName
if it is empty then exit mouseUp
put it into fileName
open file fileName
repeat with i=1 to the number of cards
go to card i
repeat with j=1 to the number of background fields
repeat with k=1 to the number of lines of bg field j
if k > 1 then write numToChar(11) to file fileName
write line k of background field j to file fileName
end repeat
write tab to file fileName
end repeat
write return to file fileName
end repeat
close file fileName
end mouseUp

How it Works
The text contents of the HyperCard stack will be put into a text file that
will read into FileMaker in exactly the same format as it existed in
HyperCard. Create a new FileMaker file with the same number of fields as
in the HyperCard stack and use the "Input From" command to read in the text
file. After the file is read in, examine the data in the fields and rename
the fields as appropriate.

This script converts all the Returns pressed inside the HyperCard fields to
vertical tabs for the benefit of FileMaker. Thus, large fields with many
lines will become large fields with many lines in FileMaker. If you want to
break field data up into more meaningful chunks (for example, "City,"
"State," and "Zip" instead of "Address") you must either modify this script
or create a calculation field in FileMaker to parse the fields using text
manipulation functions (left, middle, right, and position). Most people
find working in FileMaker more comfortable. Without writing the appropriate
script in HyperCard or building the proper formulas in FileMaker, there is
no way to "magically" convert such items into separate fields, since the
structure can vary so much.


This article is adapted from the Claris Tech Info database.
Published Date: Feb 19, 2012