Using GREP to find the first instance of something on a page
- This topic has 2 replies, 2 voices, and was last updated 9 years, 8 months ago by .
- You must be logged in to reply to this topic.
Learn / Forums / General InDesign Topics / Using GREP to find the first instance of something on a page
Learn / Forums / General InDesign Topics / Using GREP to find the first instance of something on a page
Tagged: brand guidelines, find/change, GREP, registered trademark
Hi everyone,
I have a set of brand guidelines for a company which has a complicated set of rules about when registered trademark symbols should appear after the brand name.
It boils down to: the registered trademark symbol should appear after only the first mention of the brandname on each page, unless the first mention is in a headline, in which case it should appear after the next mention.
I should be able to take care of the headline problem by only making my GREP query part of the “body” paragraph style and not part of the headline paragraph style. It’s the ‘first mention’ part which is tripping me up.
Is there a way to use GREP to find the first mention of the brandname on every page of a document and make sure there is a registered trademark symbol after it?
I’ve already got this expression:
Find: Brandname(?!~r)
Change: Brandname~r
which finds any mention of the brandname and adds a registered trademark symbol, unless it already has one (so it doesn’t add extra ones if there is one already there) but the finding first mention bit has got me well and truly stumped!
Can anyone help?
Thanks so much in advance,
Holly
No, I don’t think there is any way in InDesign to automate that. You might be able to have someone write a script to do it, though.
Ah booo!
Never mind, thanks for looking anyway!
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!