Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 87561

Re: Looking for GREP codes to automate book design

$
0
0

Sorry, for some reason I was so focused on the task of removing the tags at the same time that I for got about the formatting needing to be different for each tag. You'd need to search for each type of tag at the beginning of the paragraph individually to apply the style, so you cannot do a single find/change for everything, but you can chain them with a script like Peter Kahrel's Query Manager (InDesign: GREP queries overview | Peter Kahrel).

 

I see pixxxel schubser has allowed for the space after the tag, which I also forgot, but I think a more generic approach might be better and I'd use \s* to find any whitespace if it's there instead of just a single space. So the query would look like ^(<tag>\s*)(.+) with a change to $2 and the correct formatting for the tag.

 

Also forgot the end tags in my query....

Adding (</tag>) should remove the tags at the end as well. So a query for end tags should end up looking like (<tag>\s*)(.+?)(\s*<tag>) if the tags are mid-paragraph, or ^(<tag>\s*)(.+)(\s*</tag>)$ if they are at the the begining and end. A string that contains its own tag as a real word is a problem case mid-paragraph.


Viewing all articles
Browse latest Browse all 87561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>