Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!hellgate.utah.edu!fcom.cc.utah.edu!bioscience.utah.edu!kofoid From: kofoid@bioscience.utah.edu (Dr. Cancer) Newsgroups: comp.sys.mac.hypercard Subject: Re: Scripting Question Message-ID: <1991Feb22.225440.22356@fcom.cc.utah.edu> Date: 22 Feb 91 22:54:40 GMT References: <13258@hubcap.clemson.edu> Sender: news@fcom.cc.utah.edu Organization: Dept. of Biology, University of Utah Lines: 37 In article <13258@hubcap.clemson.edu> jcocon@hubcap.clemson.edu (james c oconnor) writes: > I want a button to disappear when a field is empty and appear the > instant a user types a character into it. My code looks like this: > > on keyDown theParm > send "keyDown" && theParm to this card > if me is empty then > hide card button "button" > else > show card button "button" > end if > end keyDown > > It works fine, except when the user types a space. Then the message > gets confused. What gets passed is probably "keyDown " and the second > space isn't interpreted as the key. Is there a good way around this? > I'd like to avoid any hacks. > > Jim This script (placed in the field itself) works fine: on keyDown theItem type theItem if me <> empty then show btn "test" select after text of me else hide btn "test" select after text of me end if end keyDown Cheers, Eric.