Getting a field name
jhurley at infostations.com
Tue Apr 6 11:15:26 CDT 2004
The two scripts below are those you suggested as a method to solve my
"get the field name" question.
Thanks you for these. They are easy to follow, and worked well. (It
only needed the "with messages" addition.)
Except for the first run after opening the file.
I find on that first run that the target (justToCheckItsValue below)
turns out to be: button "Disclosure Triangle" whatever that is--I did
click on a field and the target should have been a field.
I imagine this "Disclosure Triangle" is some hidden RR button. Since
it reports something not a field, the answer comes up "Not a field.
On all subsequent runs it works flawlessly. Any idea where that
"Disclosure triangle" comes from or how to get rid of it?
Handler in Test button
put "" into gClickedField
answer "Click on the application field."
insert script of btn "clickTrapper" into front
wait until gClickedField is not empty with messages
if gClickedField <> "***CANCEL***" then
answer "The field clicked on was:" && gClickedField
answer "Not a field. Try again." with "OK"
Handler in "clickTrapper" button
put the target into justToCheckItsValue
if word 1 of the target is "field" then
put the short name of the target into gClickedField
put "***CANCEL***" into gClickedField
remove script of me from front
I tried putting in a "put the target into throwMeAway" after the
first mouseUp just to see if I might "purge" the target function, but
to no avail.
More information about the use-livecode