home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / AppleScript / Additions / ACME Script Widgets 1.0 / Replace ƒ / Replace READ ME < prev    next >
Encoding:
Text File  |  1994-11-02  |  2.9 KB  |  86 lines  |  [ttro/ttxt]

  1.  
  2. _________________________________________________
  3.  
  4.     Replace Scripting Addition ver. 1.0b1 
  5.  
  6.             Copyright (C) 1994 Wayne Walrath
  7.  
  8. _________________________________________________
  9.  
  10. This software is free for personal use. To obtain a cheap and simple license for
  11. corporate, commercial or institutional use, contact the author at one of the
  12. addresses listed at the end of this document. THIS SOFTWARE IS PROVIDED AS IS
  13. WITHOUT WARRANTIES. USE AT YOUR OWN RISK! You are encouraged to share this
  14. software with other people and to upload it to online services, but you may not
  15. charge money for it and you should only transfer the complete package. Contact
  16. me if you doubt whether you have a complete package. Inclusion on CD-ROMs
  17. requires explicit permission from me (the author).
  18.  
  19.  
  20. Replace is a general purpose search and replace tool for AppleScript. You can
  21. specify one or more strings to search for in one or more target strings, and
  22. each occurrence will be replaced by the specified replacement text.
  23.  
  24.  
  25. INSTALLATION:
  26. ______________________
  27. To install: Drag Replace to the Scripting Additions folder inside the
  28. Extensions folder.
  29.  
  30.  
  31.  
  32.  
  33. USAGE:
  34. ______________________
  35.  
  36. replace <anything> in <anything> with <string> [ all occurrences <boolean> ]
  37.  
  38.  
  39. The first parameter specifies the strings or list of strings to search for.
  40.  
  41. The second parameter is the string or list of strings to search in.
  42.  
  43. The third parameter is a string which will be substituted for each occurrence of
  44. the find strings (first parameter) in the returned text.
  45.  
  46. The last parameter is optional and specifies whether only the first parameter
  47. should be replaced (pass true), or all occurrences (pass false); replace all is
  48. the default.
  49.  
  50. All strings are unlimited in length (limited only by available memory), and
  51. anything that AppleScript can coerce to a string is legal (e.g., integers,
  52. floats, etc.)
  53.  
  54. If you pass a list of strings to search for, they are replaced one at a time
  55. in the order they are passed. If you specify that only the first occurrence
  56. should be replaced, each one of the search strings will be replaced once. This
  57. might be useful if you wanted to replace the first X number of a certain string.
  58. For example:
  59.  
  60.     replace {1, 1, 1} in "12121212" with "_" all occurrences false
  61.  
  62.     =>    "_2_2_212"
  63.  
  64. Three of the ones (1) were replaced with "_", and the rest left untouched.
  65.  
  66.  
  67. I've provided a variety of examples to demonstrate the uses for Replace in the
  68. demo script included with this package. Spend a few minutes playing around with
  69. them to get a feel for the tool, and if you still have questions contact me.
  70.  
  71. ______________________
  72. Comments, bug reports and suggestions are welcomed. If you have any ideas for
  73. useful Scripting Additions which haven't been written yet, send me a message
  74. describing your idea.
  75.  
  76.  
  77.  
  78.     ___________________________
  79.         Wayne Walrath
  80.         2010 Ravenswood Dr.
  81.         Evansville, IN 47714
  82.         (812) 476-8610
  83.         walrath@cs.indiana.edu
  84.         CIS: 70233,3151 
  85.     ___________________________
  86.