What's the purpose of this? I don't know of an automatic way, but there might be another way or option if you tell us what you are trying to do?
A textframe (empty).
When you start to type text, a line in the background appears under the text.
This line has a tint, and is functioning like a background with a color.
I want this line to continue on every new textline but this only works when there is a hard return at the of the text.
So, I thought, what if I use a grep that automatic gives a hard return at the end of a textframe.
See the examples
Is there a reason that adding a fill color to the frame won't work?
Yes. The reason is a workaround for Web2Print.
Web2print uses a Indesign server, so if I find a solution for this it saves us about 2.000 euros.
The supplier charges that amount of money for doing it for us. He uses XLST...
I'm afraid I don't understand why adding a fill color would add anything to the cost of the job. I work part time as a tech support specialist for PrintUI.com, a supplier of InDesign Server processing of client templates in Web-to-Print applications, and while I can't speak about any competitor's system, adding a fill color to a text frame with us would have no more effect on processing than adding an empty filled rectangle as a background, something many of our designers do. Rendering time change would be insignificant.
If you need a frame that is only partly filled, though, that's a different situation, but I've seen many client templates on our system that use filled text frames or filled shapes behind text frames.
You are absolutely right!
I really want to take control over these issues. No way that this will cost us 2000 euros.
So, when I find out a workaround (And I know there must be...) I have the control. I am no longer dependent of the supplier.
I am so close to a solution... the only thing is the hard return thingy...
What I didn't mentioned is that the text frame is not visible. But when you start to type the line wil appear.
The forum seems to be non-responding, so I don't know if this will go through...
Do you have the ability for your users to add the fill color to the frame manually?
I have some time for this issue...
No, the user doesn't have the ability to add color.
That is 'locked' in the corporate identity.
If you have to apply the "hightlight" as a paragraph style (which is really a thick rule offset above/below text) rather than coloring the text frame, below is some GREP code (bolded text) that might help:
It looks for any character at end of paragraph not followed by a hard return, and adds one at the end of the "found text".
That will find absolutely nothing but the end of the story. By definition the end of a paragraph is a hard return so the only place you can have a paragraph that doesn't have a return at the end is the last paragraph in a story.