• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

grep style

Participant ,
Aug 11, 2020 Aug 11, 2020

Copy link to clipboard

Copied

why can't I assign a paragraph style in a grep style?

TOPICS
Feature request , How to

Views

433

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 11, 2020 Aug 11, 2020

Copy link to clipboard

Copied

Because the purpose of a grep style is to apply one character style or more on a part of a paragraph

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 11, 2020 Aug 11, 2020

Copy link to clipboard

Copied

there are complex texts, with recurrences. I just say that activating a paragraph style based on keywords or certain successions would be a time-saving solution.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 11, 2020 Aug 11, 2020

Copy link to clipboard

Copied

Because it simply does not make sense. If you were to apply a pstyle based on a condition, it makes sense to have that condition defined somewhere other than inside a pstyle. If it works the way you want, then you will create a pstyle then define to change it based on the condition defined within it, all too complex and non intuitive.

-Manan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 11, 2020 Aug 11, 2020

Copy link to clipboard

Copied

I have text that flows in two columns. I have a recurring paragraph style with a colored background managed by a colored line. All of this is a paragraph style. Some kind of recurring headline. Then an italic style that activates at the forced line break, intermediate styles that are activated with some keywords.
I have a style that defines the month and flows on the two columns... necessarily managed by a paragraph style. It could be grep, because it's the name of the month... but these are some of the examples that I find myself in text that is unique text, but that I can compose using paragraph styles and character styles, but predominantly paragraph styles. If I could activate paragraph styles on certain unique occurrences... for example, a certain text or a succession of texts... would be a great time saver. That's why it would make sense what I asked for.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 11, 2020 Aug 11, 2020

Copy link to clipboard

Copied

The use case you mentioned surely warrants an easy and fast way out. What i was trying to put across was, how would such a thing be designed in a generic way and for that it seems unintuitive to have the setting inside the pstyle. Having said that, i also vote for Find/Change workflow, that is the only thing that comes to mind when thinking of using something that's existent out of the box.

-Manan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 11, 2020 Aug 11, 2020

Copy link to clipboard

Copied

yet what I ask is very simple ...
Haven't you paginated a catalog or a classifieds magazine where the layout is always the same, but you have to use paragraph styles? With activation "keys" the operation would be immediate: insert the text and you have everything perfectly formatted. I am simply asking to include paragraph styles in grep styles. But look, nothing changes, if they are not used there is only one more function, but why exclude it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2020 Aug 12, 2020

Copy link to clipboard

Copied

What would really be helpful is if you showed a screen shot. What you're asking for is actually not very simple because if you're trying to format text within a paragraph, then it would not be a paragraph style but instead a character style. Again, we're all trying to imagine what this looks like so a screen shot of your text would be very helpful.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 12, 2020 Aug 12, 2020

Copy link to clipboard

Copied

"Simple" is in the eye of the beholder :). Adding a significant new feature to a 20-year-old  software application would be described by few people as simple.

 

There is an out-of-the-box workaround to accomplish what you're trying to do (GREP Find/Change and/or FindChangeByList script). However, if you'd like to add that as a feature to InDesign, the place to make that request is the Adobe User Voice site. You can promote that request with your co-workers, friends and colleagues, and if enough people find it useful and vote on that issue, the Adobe team will take notice.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 11, 2020 Aug 11, 2020

Copy link to clipboard

Copied

One way to speed up your workflow would be to use a GREP Find/Change to apply the paragraph styles, or better yet, use the FindChangeByList script that ships with InDesign.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 11, 2020 Aug 11, 2020

Copy link to clipboard

Copied

it's just like I'm doing now. But the updates have deleted my searches, but not the styles (thankfully). From this event I made my request. If I save my research and then lose them after an update... then allow me a style that includes them all!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 12, 2020 Aug 12, 2020

Copy link to clipboard

Copied

Have you tried the FindChangeByList script? You can plug in all of the changes you want to make in the text file that accompanies the script, and they will be saved in the file. And when you run the script, all of the changes will be made at once.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 12, 2020 Aug 12, 2020

Copy link to clipboard

Copied

no -- I don't have script experience though. I tried to open the script from the list, but it's not clear to me how it works, nor how to make it work... I don't see "run" buttons ... "play" or similar.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2020 Aug 12, 2020

Copy link to clipboard

Copied

Usually if a feature request can be solved via simple scripting it never gets added.

 

The FindChangeByList script can be difficult for beginners because it offloads the scripting code to a rather complex text file, which the user needs to edit—to me the text file seems more difficult than a customized script.

 

A script to run multiple searches for an applied paragraph style with a string of text, is not complicated. Something like this where the line grepSearch("StyleToSearch", "GrepCode", "StyleToReplace"); defines the paragraph style to search for, the grep search code, and the replacement style. You can repeat the grepSearch line as many times as needed, all you have to do is edit the 3 items making sure they are enclosed in straight quotes:

 

 

 

 

//seaches for a Paragraph Style named "Text", which contains text found by grep, and replaces with a Paragraph Style named "AltText"
grepSearch("TextStyle", "\\t+", "AltTextStyle");

//another search. IMPORTANT when the grep code includes a backslash it needs to be escaped with another backslash
grepSearch("HeadStyle", "\\s+", "AltHeadStyle");


function grepSearch(fp, grp, cp){
    app.findGrepPreferences.findWhat=NothingEnum.NOTHING
    app.changeGrepPreferences.changeTo=NothingEnum.NOTHING
    app.findGrepPreferences.findWhat = grp;
    app.findGrepPreferences.appliedParagraphStyle = fp;
    app.changeGrepPreferences.appliedParagraphStyle = cp;
    app.activeDocument.changeGrep( true )
}

 

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 12, 2020 Aug 12, 2020

Copy link to clipboard

Copied

LATEST
If you're comfortable working with JavaScript, then Rob's idea may work better for you, but if you'd prefer to use the FindChangeByList script, then you can run it by double-clicking it from the Scripts panel.
 
However, before doing so, you'll want to edit the FindChangeList.txt file to add your changes. From the Scripts panel, click on the arrow to the left of the FindChangeSupport folder. Right-click on the file inside that folder and choose Reveal in Finder/Explorer. From Finder/Explorer, double-click on the file to open in your default text editor. There are some basic instructions and some examples to use 
 
For example, to apply the paragraph style named "Month" to a paragraph that begins with a month of the year, you could use the following:
 
grep {findWhat:"^.+uary|March|April|May|June|July|August|.+ber"} {appliedParagraphStyle:"Month"} {includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:true, wholeWord:false}
 
In the above example, those are tabs between each item in curly braces rather than regular spaces.
"...} + Tab + {..."

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines