home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-02 | 2.9 KB | 86 lines | [ttro/ttxt] |
-
- _________________________________________________
-
- Replace Scripting Addition ver. 1.0b1
-
- Copyright (C) 1994 Wayne Walrath
-
- _________________________________________________
-
- This software is free for personal use. To obtain a cheap and simple license for
- corporate, commercial or institutional use, contact the author at one of the
- addresses listed at the end of this document. THIS SOFTWARE IS PROVIDED AS IS
- WITHOUT WARRANTIES. USE AT YOUR OWN RISK! You are encouraged to share this
- software with other people and to upload it to online services, but you may not
- charge money for it and you should only transfer the complete package. Contact
- me if you doubt whether you have a complete package. Inclusion on CD-ROMs
- requires explicit permission from me (the author).
-
-
- Replace is a general purpose search and replace tool for AppleScript. You can
- specify one or more strings to search for in one or more target strings, and
- each occurrence will be replaced by the specified replacement text.
-
-
- INSTALLATION:
- ______________________
- To install: Drag Replace to the Scripting Additions folder inside the
- Extensions folder.
-
-
-
-
- USAGE:
- ______________________
-
- replace <anything> in <anything> with <string> [ all occurrences <boolean> ]
-
-
- The first parameter specifies the strings or list of strings to search for.
-
- The second parameter is the string or list of strings to search in.
-
- The third parameter is a string which will be substituted for each occurrence of
- the find strings (first parameter) in the returned text.
-
- The last parameter is optional and specifies whether only the first parameter
- should be replaced (pass true), or all occurrences (pass false); replace all is
- the default.
-
- All strings are unlimited in length (limited only by available memory), and
- anything that AppleScript can coerce to a string is legal (e.g., integers,
- floats, etc.)
-
- If you pass a list of strings to search for, they are replaced one at a time
- in the order they are passed. If you specify that only the first occurrence
- should be replaced, each one of the search strings will be replaced once. This
- might be useful if you wanted to replace the first X number of a certain string.
- For example:
-
- replace {1, 1, 1} in "12121212" with "_" all occurrences false
-
- => "_2_2_212"
-
- Three of the ones (1) were replaced with "_", and the rest left untouched.
-
-
- I've provided a variety of examples to demonstrate the uses for Replace in the
- demo script included with this package. Spend a few minutes playing around with
- them to get a feel for the tool, and if you still have questions contact me.
-
- ______________________
- Comments, bug reports and suggestions are welcomed. If you have any ideas for
- useful Scripting Additions which haven't been written yet, send me a message
- describing your idea.
-
-
-
- ___________________________
- Wayne Walrath
- 2010 Ravenswood Dr.
- Evansville, IN 47714
- (812) 476-8610
- walrath@cs.indiana.edu
- CIS: 70233,3151
- ___________________________
-