home *** CD-ROM | disk | FTP | other *** search
/ Netscape Plug-Ins Developer's Kit / Netscape_Plug-Ins_Developers_Kit.iso / EDITORS / grinder / wheels / find2.hqx / find_replace.hqx / background_3858.txt < prev    next >
Encoding:
Text File  |  1995-03-28  |  1.8 KB  |  74 lines

  1. -- background: 3858 from stack: in.hqx
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on enterkey
  8.   set the hilite of cd btn "find & replace" to true
  9.   wait 5
  10.   set the hilite of cd btn "find & replace" to false
  11.   send mouseup to cd btn "find & replace"
  12. end enterkey
  13.  
  14. on converter thefile,thecontents
  15.   global totalchanges
  16.   if totalchanges is empty then put "0" into totalchanges
  17.   put thecontents into cd fld "holdText"
  18.   -- put the hilite of cd btn "whole word" into wholer
  19.   put cd fld findText into finder
  20.   put cd fld changetext into changer
  21.   put 0 into lastfind
  22.   repeat forever
  23.     if there is a window "grinding..." then
  24.       if iconnum =1
  25.       then put 3 into iconnum
  26.     else put 1 into iconnum
  27.     set i3_name of window "grinding..." to "grinder"&iconnum
  28.   end if
  29.   set cursor to busy
  30.   -- if wholer
  31.   -- then find whole finder in cd fld holdtext
  32.   -- else
  33.   find string finder in cd fld holdtext
  34.   if the foundchunk is not empty then
  35.     get word 2 of the foundchunk
  36.     if it <= lastfind
  37.     then exit repeat --we've gone all the way through and started over
  38.   else put it into lastfind
  39.   add 1 to totalchanges
  40.   put changer into the foundchunk
  41. else exit repeat
  42. end repeat
  43. ReplaceFile thefile,cd fld holdText
  44. end converter
  45.  
  46. on alldone
  47.   global totalchanges
  48.   get totalchanges&&"occurrences were changed."
  49.   put "0" into totalchanges
  50.   send "alldone it" to homie()
  51. end alldone
  52.  
  53.  
  54. -- part 6 (button)
  55. -- low flags: 00
  56. -- high flags: 2001
  57. -- rect: left=2 top=189 right=206 bottom=21
  58. -- title width / last selected line: 0
  59. -- icon id / first selected line: 29540 / 29540
  60. -- text alignment: 1
  61. -- font id: 0
  62. -- text size: 12
  63. -- style flags: 0
  64. -- line height: 16
  65. -- part name: Help
  66. ----- HyperTalk script -----
  67. on mouseUp
  68.   fullhelp
  69. end mouseUp
  70.  
  71. on mouseenter
  72.   helper "Click here for more help for HTML Grinder."
  73. end mouseenter
  74.