finding text in HTML file

Hi -

I’ve got an AppleScript that opens an html file that is located on my hard drive. I’d like to add something to it to find a certain string of text and change the font of that text when the file is opened. Anyone have any idea how to do that?

Thanks!

Miriam

Do you mean in a text editor, or in a browser?
If in a browser, you need a simple search-replace routine. Eg, replace “bad” with “bad”. You can try this one:
http://macscripter.net/exchange/comments.php?id=198_0_1_0_C

If in a plain text editor, you can try “Tex-Edit Plus”, which is a super-scriptable-and-also-recordable text editor with lots of lots of sample scripts:
http://www.malcolmadams.com/te/

Is there a way to use regular expressions in applescript?

Thanks, JJ! The html file is set to open in the user’s default browser, so I’m going to try your first solution.

Miriam

Satimage osax allows you to use regular expressions in scripts.

– Rob

BBEdit has regex, and it is applescriptable.

There’s also the freeware OSAX mgrep.

Jon