Looping Script Chokes

I wrote a script to handle changing some fonts in a lot of Word produced html files. The script works, but it sometimes hangs up for long periods. It always seems to come back. Another bad thing: it craps out if I run it on more than about 600 files at a time.

I’m running Snow Leopard and Word 2011 on an Intel iMac with a 2.93 GHz Core 2 Duo.


set theFolder to choose folder
tell application "Finder" to set thefiles to entire contents of theFolder

activate application "Microsoft Word"


repeat with aFile in thefiles
	tell application "Microsoft Word"
		open (aFile as string)
		
		
		#clears Titles
		
		set myFind to find object of text object of active document
		clear formatting myFind
		set name of font object of myFind to "Helvetica"
		set font size of font object of myFind to 14
		set italic of font object of myFind to yes
		set content of myFind to "^?"
		clear formatting replacement of myFind
		set content of replacement of myFind to ""
		execute find myFind replace replace all
		
		
		#clears Space above "Safety"
		
		set myFind to find object of text object of active document
		clear formatting myFind
		set name of font object of myFind to "Helvetica"
		set italic of font object of myFind to no
		set content of myFind to "^pSafety"
		clear formatting replacement of myFind
		set content of replacement of myFind to "Safety"
		execute find myFind replace replace all
		
		#replace Times with Helvetica in body of comparison
		
		set myFind to find object of text object of active document
		clear formatting myFind
		set name of font object of myFind to "Times"
		set content of myFind to ""
		clear formatting replacement of myFind
		set name of font object of replacement of myFind to "Helvetica"
		set content of replacement of myFind to ""
		execute find myFind replace replace all
		
		save active document
		close active document
	end tell
end repeat

Model: 24" iMac 2.93 GHz Core 2 Duo
AppleScript: 2.1.2
Browser: Safari 533.21.1
Operating System: Mac OS X (10.6)

BTW, I ave been running this from the Script Editor, if that makes any difference.