FORMalizer.rev
Peter Brigham MD
pmbrig at gmail.com
Mon Mar 16 21:22:55 EDT 2009
The best reason in the world to build a tool is because you need it.
So I have been putting together a utility that I have been wanting for
a while now. I found myself continually filling out paper forms by
entering data that I had stored digitally and feeling that I was
wasting hours of time cumulatively in a really boring endeavor. If you
face the same problem, here is something that might help. FORMalizer
is a stack that allows you to import a scanned PNG or JPG image from a
paper form and overlay fields that you arrange.
Once you have set up all your fields and adjusted your layout, click a
button to clone the stack, and FORMalizer closes, leaving a free-
standing stack containing your form and fields. Now set the mainstack
of your new form to an existing stack system. Once you have done that,
click a button and a script snippet is generated with a line for every
field in your form. It looks something like this:
put empty into fld id 1280 of card 1 of \
stack "initAssmt" -- gender
put empty into fld id 1281 of card 1 of \
stack "initAssmt" -- DOB
put empty into fld id 1282 of card 1 of \
stack "initAssmt" -- age
Paste the script snippet into any handler in your stack system that
you want to handle the printing. Then you can adjust the script so it
looks something like:
put toUpper(char 1 of gender) into fld id 1280 of \
card 1 of stack "initAssmt" -- gender
put fld "DOB" into fld id 1281 of card 1 of \
stack "initAssmt" -- DOB
put doAge(fld "DOB") into fld id 1282 of card 1 of \
stack "initAssmt" -- age
Any unaltered lines ensure that the corresponding field is emptied.
The script snippet ends with some commands for printing -- all the
rest of the scripting is contained in the FORMalizer substack.
Feel free to try it out and use it ad lib. It's developed on a Mac but
should work on Windows -- on the other hand, cross-platform stuff is
sometimes tricky. I'm willing to try to iron out any wrinkles left in
it if enough people are interested. I think there are a couple lines
of script that make it only a Rev 3.0+ tool, but if someone wants a
version that runs in 2.9 I could probably adjust it accordingly.
I guess that one or another of the really great report-generating
utilities can do this kind of thing as well, but I think it's fun to
build your own tools. Plus, it's cheaper.
Available at RevOnline, username pmbrig
Peter M. Brigham
pmbrig at gmail.com
More information about the use-livecode
mailing list