I have some text. I changed it to outline. Drew a rectangle on it. Selected all and then pathfinder->minus front. I got a weird result. How can get my desired effect in this way?
The easiest method is to change the color of the rectangle to something other than the type color. I'd choose white.
Pathfinder > Merge.
Select > Same > Fill & Stroke
Merge combines shapes of similar fills and removes any other shape below. So if your rectangle is white, it'll combine with the counters if they touch it (like in the B) and it will delete the underlying black portion of the type shapes. Then selecting similar just lets you select and delete all the white in 2 steps. You are left with only the black top portion of the type shapes.
For this you first need to select all of the letters and create a compound path. Object>Compound Path>Make THEN do your pathfinder minus front.