Jump to content
Sign in to follow this  
David in MA

Is there a way to search for beginning of wrapped line?

Recommended Posts

The ^ and $ in regular expressions search for begging and end of lines which are delimited by paragraph or newline characters. I want to search for the beginning or end of a line that has been wrapped by the formatting. For example, if the last word of a paragraph is the only word on that line. I can search for the last word of the paragraph, but there seems to be no way to search for the line wrap just before it.

Share this post


Link to post
Share on other sites

I think the search may happen on the raw text input rather than it's post wrapped state in the text frame. It seems it will only pick up things that are physically placed into the text, such as paragraphs, frame breaks, line breaks etc. You can see a list of these if you click the search magnifying icon > Special Characters, when typing your search terms. I can't get it to detect any of  the automatic formatting at all.

Share this post


Link to post
Share on other sites
3 hours ago, GarryP said:

Why are you searching for the start/end of a line of text?
I’m not saying that you are wrong to do so, I’m just curious as to why you want to do it.

Since you are curious, there is an odd grammar point in Tibetan. "Sentences" usually end with a Shad character ( ། ). If there is just the last syllable of a sentence at the beginning of a line, then the Shad character is replaced by a Rinchen Spungs Shad ( ༑ ), I suppose to indicate that it's connected to the sentence on the preceding line. So I want to be able to search for those orphaned last syllables and replace the Shad with a Rinchen Spungs Shad.

Share this post


Link to post
Share on other sites

Thanks for that, I had no idea.
If you raise this as a feature request the team might, possibly, add an automatic solution into the software so you don’t need to do it manually.

Share this post


Link to post
Share on other sites
3 hours ago, GarryP said:

Thanks for that, I had no idea.
If you raise this as a feature request the team might, possibly, add an automatic solution into the software so you don’t need to do it manually.

I use regex in InDesign with a script that marks hyphenations (hyphens at line endings) between vocals, as this is considered bad hyphenation in Finnish language. But the rule cannot be applied mechanically, as it is perfectly fine to add a hyphen between compound words the first part of which ends in a vocal and the second part (divided onto the next line) starts with one. Also, sometimes hyphenation just cannot be avoided, or the problem needs to be resolved in another way (manually rehyphenating the entire paragraph etc.) so these kinds of things simply need to be gone through manually to do the job properly.

But the point is that regular expression that at least could highlight the problematic parts or spotting them one by one, would be highly useful.

EDIT: Just checked the script and it is a complex combination of regular expressions and InDesign object model code where the latter is crucial as that is the only way to iterate through the lines of each story of the publication and examine first and last characters of a line -- the text itself probably does not contain anything (a control code etc.) that indicates wrapping and that could be searched. I am not sure if that kind of feature could be implemented, though, as an app-specific extension?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.