• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
re: Scriptable Search-and-Replace Utilities
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Scriptable Search-and-Replace Utilities


  • Subject: re: Scriptable Search-and-Replace Utilities
  • From: Kirk Kerekes <email@hidden>
  • Date: Mon, 14 Jan 2002 15:32:36 -0600

on 01/14/02 01:43 PM, email@hidden at
email@hidden may have written:

> Hello.
>
> I am searching for a search-and-replace utility that is AppleScript-able.
> I've begun testing Text Machine, but I'd like to have some outside opinions
> of it. I'd also like to know if there are other scriptable s-and-r
> utilities and what users think of them.

Consider AppleScript itself. The replace_chars routine offered in the
Essential Subroutines section of the AppleScript Guidebook:

on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars

-- is remarkably quick due to its use of the highly optimized Text Item
Delimiters function, and gains additional effective speed by not having to
use inter-application communication to do the work. I use it all the time
for fairly heavy-duty tasks like automated web-page creation for database
publishing. I have yet to break it.

For more control, you can easily create custom utilities using the TID, the
offset function, and AppleScripts "word" reference.


  • Prev by Date: Re: filtering alias files by original item
  • Next by Date: Re: Scriptable Search-and-Replace Utilities
  • Previous by thread: Re: Scriptable Search-and-Replace Utilities
  • Next by thread: Re: Scriptable Search-and-Replace Utilities
  • Index(es):
    • Date
    • Thread