Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!murtoa.cs.mu.oz.au!ditmela!diemen!lin From: lin@diemen.cc.utas.oz (Zhen Jie Lin) Newsgroups: comp.sys.mac.hypercard Subject: Re: How can I keep the tab key? Summary: New version of TabToComma Keywords: HyperCard, tabKey Message-ID: <1330@diemen.cc.utas.oz> Date: 27 Mar 90 02:19:22 GMT References: <1318@diemen.cc.utas.oz> <1328@diemen.cc.utas.oz> Organization: University of Tasmania, Tasmania, Australia Lines: 78 In article <1328@diemen.cc.utas.oz>, lin@diemen.cc.utas.oz (Zhen Jie Lin) writes: > In article <1318@diemen.cc.utas.oz>, lin@diemen.cc.utas.oz (Zhen Jie Lin) writes: > > When I try to paste some data including tab into HyperCard field, once I quit > > from the field, the tab characters disappear immediately. Is there any way that > > I can keep these tab characters so that I can use some other character (eg comma) to replace it? If I can do this, I would be able to copy some spreadsheet data > > into HyperCard without great suffer. > > > I posted the above message couple weeks ago, and have only got one suggestion > { the rest is the script} I am sorry that the script I posted last night doesn't work properly when the message box is hiding. In that case, even the insertion I beam is within the rect of the message box, the text is still to be pasted into text field instead of message box. The following script fix this problem. I apologize for any inconvenience. -- TabToComma HyperCard Script (v1.1) -- by Zhenjie Lin, PO Box 445, Sandy Bay, Hobart, TAS 7005, AUSTRALIA -- 27 March, 1990 -- -- IF YOU LIKE THE SCRIPT, JUST DROP ME A LINE, I WANT TO KNOW HOW MANY -- PEOPLE MAY USE IT. THANK YOU. -- -- My email address: lin@cmltas.cml.oz -- or lin@diemen.cc.utas.oz --When copy-paste some text from external file into HyperCard, the tab --characters will be deleted. This could be annoying in some cases, --especially when the user want to use spreadsheet data. The following --script will replace tab key with comma when pasting data into a text --field. on doMenu x global finishDoMenu put false into finishDoMenu -- if x is "paste text" then tabToComma -- {insert any other commands) -- if finishDoMenu then exit doMenu pass doMenu end doMenu on tabToComma global finishDoMenu send "doMenu paste text" to hyperCard if the visible of the message then --check whether pasting into msg box put the rect of the message into box put item 1 of box into x1 put item 3 of box into x2 put item 2 of box into y1 put item 4 of box into y2 put item 1 of the clickLoc into x put item 2 of the clickLoc into y if x>=x1 and x<=x2 and y>= y1 and y<=y2 then put true into finishDoMenu exit tabToComma end if end if put the Number of the selectedField into fldNo get the name of the selectedField if word 1 of it is "card" then repeat until offset(tab,cd fld fldNo) = 0 put "," into char offset(tab,cd fld fldNo) of cd fld fldNo end repeat else repeat until offset(tab,fld fldNo) = 0 put "," into char offset(tab,fld fldNo) of fld fldNo end repeat end if put true into finishDoMenu end tabToComma