1

Let's say I have a RTF file with the following content:

I like dogs. Most people like dogs. Some cat like dogs.

Now, I'd like to make every instance of 'dogs' bold. How can I achieve this in the simplest way possible without making all the changes manually?

2 Answers 2

3

The simplest way it to open your document in text mode (not rtf), and to do a search and replace with those parameters:

  • search for: dog
  • replace with: \b dog \b0

Save your document without modifying anything else, and it should be okay. You should make a copy of the original beforehand though, in case something goes wrong.

0

You could also open the RTF file in TextEdit and then run a script like this in AppleScript Editor:

set x to "dogs"
set text item delimiters to x
tell application "TextEdit" to tell document 1
    set ti to text items of (get its text)
    repeat with i from 1 to (count of ti) - 1
        set l to count of (items 1 thru i of ti as text)
        set font of characters l thru (s + (length of x)) to "Helvetica Bold"
    end repeat
end tell

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .