InDesign: Search & Replace, beginning of paragraph thru word

I have a document with a text frame that contains many lines of data. The data starts with a Case Number, then an address, some details and lastly a hard return:
785D851 123 Main St. Dayton, Ohio 45402 Attorney: John Smith Details, Details, Details (Hard Return)
98A52 123 Main St. Dayton, Ohio 45402 Attorney: John Smith Details, Details, Details (Hard Return)
96R287 123 Main St. Dayton, Ohio 45402 Attorney: John Smith Details, Details, Details (Hard Return)
542V964 123 Main St. Dayton, Ohio 45402 Attorney: John Smith Details, Details, Details (Hard Return)

There’s a couple hundred of these. Currently, I manually bold the beginning of the paragraph through the ZIP code for each paragraph using the text eye dropper, which takes quite a while. I’m trying to script it but I don’t know how to code “The Beginning Of The Paragraph”:

tell application "InDesign"
	--HERE'S WHERE I DON'T KNOW WHAT TO PUT:
	--set MakeBold to {(beginning of paragraph thru "Attorney:"} **(BUT I DON'T WANT TO INCLUDE ATTORNEY, I only want through the ZIP code)
		activate
	set find preferences to nothing
	set change preferences to nothing
	
	tell document 1
		repeat with anItem in MakeBold
			search document 1 with find attributes {find text:anItem} with change attributes {applied font:font "Helvetica Neue LT STD", font style:"77 Bold Condensed"}
		end repeat
	end tell
	
	set find preferences to nothing
	set change preferences to nothing
end tell

Can anyone please offer me some guidance?
Thanks - slimjim5811

You can do this with nested styles. If create a paragraph style and a coresponding character style for your bold text then go to the drop cap and nested styles, add one setting it to the character style, up to, 1 and paste in the word “Attorney”. Then any paragraph that you apply that style to will have the styled text up to word “Attorney”.

Hi Jerome,
I was interested in your solution to this as it was such a neat use of nested styles but I could not get it to work in IDCS1 or IDCS2 as the upto ends at first occurance of an individual character ie it would end at the first ‘A’ or the first ‘t’ (the word Attorney becomes a string of letter “or’s”. Checking the Adode docs seems to confirm this but you might be doing something else that I don’t know?
However Based on your solution if you use upto “:” as a start and then write a short script to search through the text to find the start of “Attorney”, move the selection point to there and then use “end nested style here” to back up the bold style you get the desired result. Even with this change I think your approach is probably more efficient than a straight search and apply character style would be.

Riverman,

You are right, it seemed to work with a quick check the other day but I admit that I didnt use Slim’s text. Upon checking it with the text I see the problem. I would still suggest nested style sheets but switch it to “Up to 1 en space”, or another “white space” that better fits the look, then just do a quick search and replace for " Attorney: " and replace with the appropriate white space character in the replace field. I think that this would be faster than developing a script to do it and result in a nice clean document.

If the script was still desirable then step through the paragraphs searching for the word “Attorney”, grab the index of the first character of the paragraph and the first letter of the word, and use these to set your styling and move to the next paragraph.

Hope this helps.

Jerome -
This Nested Style you speak of…is this in InDesign 2 or is is new to CS/CS2? We are in the dark ages here, forced to use ID2.0 due to a Database that we utilize. I’m not seeing anywhere in paragraph styles where I can stipulate a stopping point for the style.
slimjim5811

From Riverman,
Having just checked my copy of ID2.0 I think that nested styles only became available in CS1 (I was going to say and better) but I’ll leave it as “upwards”! Anyway perhaps Jerome will confirm this, about nested styles that is not my personal comments about Adobe product improvement.

Sorry Slim your out of luck, that is a CS1 and up feature. You probably need to step through the paragraphs like I suggested above.