InDesign CS3 Find/Change paragraph problem

I have several Find/Changes that need to be applied to several 50+ page stories. I’ve gotten most of the Find/Changes to script and work exactly like they would run if I manually entered the info in InDesign’s Find/Change window.

The only one that seems to work differently is one where I want to remove all tabs after a hard return. The script will actually remove the tab, but the text styling of the tab paragraph applies itself to the paragraph above it. When I use the InDesign Find/Change window, this is not an issue.

Any thoughts:


tell application "Adobe InDesign CS3"
	activate
	tell parent story of item 1 of selection

--find/change text preferences
	tell application "Adobe InDesign CS3"

--Search for the string "Text"
	set find what of find text preferences to "^p^t"
	set change to of change text preferences to "^p"
			
--FIND/CHANGE OPTIONS
	set case sensitive of find change text options to false
	set include footnotes of find change text options to true
	set include hidden layers of find change text options to false
	set include locked layers for find of find change text options to false
	set include locked stories for find of find change text options to false
	set whole word of find change text options to false
			
--FONT/PARAGRAPH&CHARACTER STYLE properties 
--CLEAR THESE STYLES
	set properties of find text preferences to {font style:nothing}
	set properties of change text preferences to {font style:nothing}
			
--DO IT
	try
		tell parent story of item 1 of selection to change text
	end try
end tell
end tell
end tell


Doh! Found it. I accidently left in a single line of code that set the applied character style in a previous find/change. Basically, I just needed to clear out the applied character style preferences before running this one.