Use GREP to apply paragraph styles, character styles not only

I have a body of text, and in it, I would like to apply a specific style to the paragraphs corresponding to a model. I did a GREP style that applied some changes formatting of paragraphs, I tried that it affects, but in doing so, I found that I couldn't Center these lines using a character style. (The corresponding lines should be centered, and the rest should be left aligned.)

I was thrilled to learn that the GREP function, then completely disappointed with this limitation. InDesign offers the possibility to automate this, so I must not cross and Center each paragraph corresponding to the hand?

Thank you!

InDesign provides a way to automate this so?

Yes and no. There is no dynamically linked paragraph styles to a paragraph about his boss, but he has at least two alternatives:

(1) use Grep-F/C

(2) use the script FindChangeByList or MultiFindChange which is basically automate operations F/C

HTH

Loïc

Tags: InDesign

Similar Questions

  • How to avoid overwriting the italics when you apply paragraph styles?

    First of all, let me say thank you to the community of Adobe's Forum for the great help over the years! You Rock! 9 times out of 10 you nail!

    OK, so I have a long document full of italics, bold and accents. Successfully, I imported the text in MS Word and kept these text features using the import options. But now, when I go to apply paragraph styles, the italics are lost. Is it possible to implement paragraph styles so that they maintain Roman, italic, bold and also special characters like accents? Thank you!

    Hi David: I just put upward (and record) queries for search/replace that I of course after you import all text. For example, I have one that is italic in the document and it goes to a character called italic style. Once I saved queries, it is very fast to run on all the stories at the same time. And once the local formatting is managed through character styles, it is intact by assigning paragraph styles.

    ~ Barb

  • GREP find the paragraph style

    Hi guys,.

    I use this grep to search for all words that use the body text paragraph style.

    However, I get the same result if I specify a paragraph style to find or not.

    The result is always the same. Why is this?

    app.findGrepPreferences = null;

    var found = app.findGrepPreferences.findWhat = "\\b\\w+?\\b";

    found.appliedParagraphStyle = "Body text";

    Found = App.activeDocument.findGrep ();

    Alert ("this document has" + found.length + "words");

    gives the same result as

    app.findGrepPreferences = null;

    var found = app.findGrepPreferences.findWhat = "\\b\\w+?\\b";

    Found = App.activeDocument.findGrep ();

    Alert ("this document has" + found.length + "words");

    app.findGrepPreferences=null;
    var found = app.findGrepPreferences.findWhat="\\b\\w+?\\b";
    app.findGrepPreferences.appliedParagraphStyle=app.activeDocument.paragraphStyleGroups.item("body").paragraphStyles.item("Body text");
    found=app.activeDocument.findGrep();
    alert("This document has "+found.length+" words");
    

    (^/)

  • InDesign CC 2015 (do not apply paragraph styles)

    Hello

    InDesign doesn't apply paragraph styles. Said she, but nothing has changed. Someone else has the same problem?

    Thank you

    Have you looked to see that a character Style is accidentally applied on the same text? Character styles replaces the paragraph style attributes.

  • How to remove paragraph styles select only

    Hi friends,

    How to remove paragraph styles select only

    Example:

    CO_H3

    COCPN

    COINT1

    COINTT

    Line of credit

    Head of design issues

    Design A-Head Mtrs

    Design Mtrs Hd

    EOC-nl-listitem

    Literate EOU continued

    Thank you

    Hi Karthik,

    Please try this code

    indesign #target

    var allStyles = app.activeDocument.paragraphStyles;

    var total = allStyles.length;

    var arrPosition = 2;

    myInput ();

    myInput () function

    {

    var myParStylesList = app.activeDocument.paragraphStyles.everyItem () .name

    var w = new window ('dialogue', ' ParagraphStyles applied: ");

    var myInputGroup1 = w.add ("group");

    myInputGroup1.add ('statictext', undefined, ' paragraph style: ");

    myInputGroup1.alignment = 'left ';

    var myDropdown1 = myInputGroup1.add ('dropdownlist', undefined, myParStylesList);

    myDropdown1.selection = 1;

    var myButtonGroup = w.add ("group");

    myButtonGroup.alignment = 'right ';

    myButtonGroup.add ('button', undefined, 'OK');

    myButtonGroup.add ('button', undefined, 'Cancel');

    w.Show ();

    r = [myDropdown1.selection.text];

    for (i = 2; I have<>

    {

    If (allStyles [i] .name is r)

    {

    allStyles [i] .remove ();

    Return r;

    }

    on the other

    {

    arrPosition + 1

    }

    }

    }

    Kind regards

    Barry B.

  • How to use GREP to apply the character style just for the first and the second line of the paragraph?

    as the title, I just want to ask how to apply the style of character just for the 1st and 2nd line of the paragraph. Help me pls, tks!

    Can you show the screen shot with the invisible market, looks like you feedback after each line.

    So, something like this would work where I have a return forced for the linebreak (shift + return). The example on the right does not work because the line break is a return:

  • Use Grep to add superscrpt style symbol character $

    I have a style of object which, among other things, apply a style of papragraph, in this paragraph style, I want to use GREP to find any instance of $, and apply a character style

    the problem I have is that it seems not recogize the symbol $

    In GREP, you must escape the symbol $ . Use: \$

    @+

    Marc

  • I can target fat with GREP - in dialog paragraph styles?

    Hello.

    I have a number of paragraphs which are mainly "regular" (as the font style: ordinary) but they also have a few bold throughout.

    I'm doing a paragraph style that will apply a character style to text bold using GREP.

    Is there a GREP code for this (to not apply the character for the "BOLD" style and nothing else)?

    I know it's easy to do in the Find/Replace dialog box, but I wonder about the paragraph style dialog box in the GREP section.

    Any help would be greatly appreciated.

    Hello

    Indeed, it is easy to do.

    You do not have to use GREP, you can use the query to search/replace text.

    Start by creating your character for "BOLD" style. (Let's call it "CBold")

    Then create your paragraph style, with your desired settings (let's call it "PReg")

    Finally, click on search it icon 'specify attributes to find', 'Bold' and replace it with character styles and paragraph previously defined:

    Who will do the job.

    Please note that this "erases" all text attributes (for example, italic...) in your paragraph.

    Also, it will apply changes to paragraph all if no style is specified in the search for options: including securities i.e.

    So, be careful when you use this method...

  • GREP find/replace + paragraph Styles

    Hello

    I'm editing a long document and have benefited from the assistance of the community already, but being new GREP Style, find/replace, I need to ask for additional help.

    Below a screenshot of the script (original). Two blocks of text you see anticipated by the icons have have styles of different paragraphs. Icons are placed like custom glyphs.

    Now, the last line with C2, 9, 14,... is the target of this post. They are buses of London and I created a paragraph with another icon. The copy that I work with unfortunately is as you see. Buses will follow «;»

    Resulting to place a \r after the semicolon and assign the new paragraph style. The item to work with is (probably) the last "," before the registration of the bus. All entries have it in the same way, where a search/replace global grep should work fine.

    My attempts:

    I used of a previous debate (? < =------;)) [^ ;] + $ to match everything from the end until the last semicolon, but then I found the problem preserving the matched characters and placing \r (using the (? < =-;). start at the beginning and stops at each point comma + space)

    So question: how to stop at the first semicolon at the end and replace the space with \r to create a new paragraph?

    Then, it is two question :-)

    From my previous attempts, I noticed that when you replace the semicolon + space with \r, and change the style of paragraph at a time (from Rail to Bus) caused the Rail paragraph style change (logic) to the style of Bus. So I tried to say the paragraph style of the track "Following paragraph Style is style of Bus" (and not to change the paragraph style in find/replace), but in a way that no longer works.

    Second question is: given to split the find/replace in two steps, how then transform / apply to newly created paragraph the correct style of Bus?

    Thank you in advance for your valuable assistance. So far, the community has been great!

    Antonio

    Original

    Screen Shot 2016-07-12 at 22.32.23.png

    Result for

    Screen Shot 2016-07-12 at 22.54.51.png

    Hi Antonio,.

    If I understand correctly, in 2 regex [1 click play with Multi/find-replace our friend Martinho da Gloria]:

  • Table of content not applying paragraph styles do not

    Hello

    Intensely frustrated, but assuming that I have do just something stupid I can't understand.  I use CS4.

    Try to make a table of contents.  Everything will import correctly in the table of contents - I because of paragraph styles to the different levels, I've wanted to, etc., including some of the hidden layers.  All these import correctly.

    I did the paragraph styles for the real KNOCK out and filled in the box for each to apply to the specifc level.  The basic indentation formatting etc. I am applying work, but features and the font size will not change.

    When I look at each paragraph style, everything entered in the way that I want it to be (that is, text formatting, etc.).  I can go to my OCD manually and click on the section of text and apply the style to the paragraph I want and apply the recesses, etc., but the formatting of the text is not.  I have to go to character styles to make it work.

    If I go into another section of my document, apply that same paragraph text style, then all (characteristics of fonts & renfonçait changes etc.).

    Looks like you can have styles of characters applied to text in the document itself, and these character styles are preserved. Local formatting and character styles applied in the paragraphs are retained when you make the table of contents.

    Many users doesn't seem to understand the distinction between character and paragraph styles, too and using character styles incorrectly. I'm not saying that it's true for you, necessarily, but you should undersand this character styles are used to change the font attributes for bit isolated from the text in a paragraph. The basis for the type specification is part of the paragraph style, and there should be no reason to apply a style of character with the exception of special cases - some words or characters - in the paragraph. Text most will have no style applied character.

  • Police applied paragraph style

    Hello

    The paragraph contains more than a fontstyle.  If I use the code below, its name to return a single style police.

    Alert (app.selection [0] .fontStyle)

    How can I get all the style applied paragraph font?

    Thanks in advance,

    Sudha K

    Hello

    Try this...

    alert(app.selection[0].textStyleRanges.everyItem().fontStyle);
    

    Concerning

  • Self-propagating ampersands in GREP in a paragraph style

    Hello. I use GREPs in paragraph styles (InDesign CS6) the color of specific words and struck a strange thing, when the words I'm trying to color include an ampersand (&).

    The style works fine the first time, but if I call the paragraph style, and extra sales begins to appear in the GREP expression, not only to the expression, I am changing, but other expressions that include an ampersand as well.

    Example: I enter track ^(?i)------& field

    The next time I have change a grep in this style, the grep goes to the track to ^(?i)------& & field. ^(? (I) then track------& & & field.

    If I go out the extra mostapha, only to see them back. And have a space or not having not spaces on each side of the ampersand does not work

    impact on the problem. I tried to use \s instead of space, but it makes no difference. I also tried dumping my InDesign preferences and export the document as a file .idml in an effort to clear all funky.

    ampersand1.jpgampersand2.jpg

    Has anyone seen this? Thank you!

    Kelly

    Sorry, I have never seen it before.

    A vague assumption: many styles with Grep?

    But maybe you try this instead:

    (? i) a\x e {26}

  • GREP to change paragraph style?

    Many people, I have a one for all what you out there smart people. I think GREP can be used to change the formatting in the next instance, but I have no idea how set up.

    I have a very long document, essentially a telephone directory of type list of names, telephone numbers, addresses, well over 150 pages. Paragraph styles are fairly simple, two only by registration. The name/phone number is "BOLD", with a tab on the right points pointing to a phone number that is aligned to the right of the column. The following lines are at the same level on the left, not fat, but indented 6pts. I placed the text file and assigned the NameListing paragraph style to the whole thing. I would like to use GREP to find lines of addresses and change the paragraph style NameListingAddress.

    Here's a screenshot to give you an idea of screen. The left column is correctly formatted with both styles, the right column is "raw", all paragraphs formatted with the paragraph style NameListing.

    What is an application suitable for GREP? If so, how I set it up to only change paragraphs who "do not have tabs? It would save me a crapload of time.

    Screen shot 2011-11-15 at 8.10.43 AM.png

    THANKS again! -Dina

    The easy way would be to do the reverse of what you're trying: together all the paragraphs of your NameListingAddress style (rather than NameListing). And then do a plain old ordinary search for tabs, do not put anything in the line of "change of...". "(or put another tab in) but the value of change in Format to the NameListing style paragraph in the context menu. Change (after you have checked some of them to make sure it's doing what you want).

    It is probably a way to do this with GREP, but it would be much more difficult.

  • Style GREP in the paragraph style

    I am wanting to create a GREP style that uses a character style. Whenever certain words (no classes) appear followed by dates. Sometimes, it's a unique and sometimes more than one date. For example:

    No class 7/11.

    No class 7/11-8/11.

    What I have so far is:

    No class \d+.

    It works very well through the words 'No class' and the first digit, but not for the whole sentence. I tried different combinations, but nothing works.

    Can anyone help?

    Jay

    The first expression grep in your screenshot does not work because you have added / /, which I should have mentioned should be omitted (including all spaces preceding) - sorry about that. It should read this:

    No class\s [-\d /] +.

    The hyphen is necessary to match the dates like 7/11-8/11.

    As the level of positions with dates and parental guidance optionally, this one works on your example:

    \d[-\d\. My] + [my] (, demands. +)?

    which is a little more secure that Reese, it's because it requires that the date ends in M or y. The? Suite (, requires) makes between it brackets in option. Remember that grep is case-sensitive: If your months can be tiny m thus, use [-\d\.] MMY] for your character class. You may need to tighten the grep to match the dates according to the formats possible.

    Peter

  • Not applying paragraph styles does not correctly

    I don't know even how to describe this problem except that... weird.

    For example: I put a style particular to 21 PT 22 PT. leading. When I apply this style to a paragraph, it sets the text to 42/44 - twice as big. Even with a heading style. I updated PT. 41 and it comes out to pt 82. It does this for all my styles. The '+' is not appear on any of them, this isn't a matter of substitution.

    Has anyone else seen elsewhere? I'm getting nowhere attempting this nail.

    TIA

    The text has been transformed? This will mess up the paragraph styles. Do not apply to the size of the game. The paragraph style will be applied, but then the transformation will also be applied.

Maybe you are looking for

  • Satellite T110-10 x - LED WAN wireless turn does not on

    Hi guys,. I have this model * T110-10 x * and I was wondering what should the front LED for Wireless WAN should be flashing or turning?It comes to the specifications of the model page:[http://eu.computers.toshiba-europe.com/innovation/product/Satelli

  • Re: Problem loading Win7 installation on Satellite A210-1AP

    Hy. I have laptop Satellite A210-1AP that came with vista 32. Now, I want to do a clean install with win7 x 64, but it does not start the installation program.Same problem happened when I tried to install fedora. With the cd supplied with the product

  • HP 260: Win 7 preinstalled (downgrade to win 10), how to upgrade to win 10?

    New York has new system win 7 preinstalled (through downgrade rights to win 10). How can I update to win 10. I'm just a normal life online? Thank you!

  • IPod music and videos displaying not not Sandisk App

    Hi all Just bought a Sandisk Connect Wireless Media Drive 64 GB for my nephew for Christmas. Thought it would be a neat gift and was hoping to get one for me and another Member of the family. But I'm a little disappointed because I can't solve a prob

  • HP210 G1 Notebook: updates of Windows 8

    I recently bought a laptop computer to the G1 HP210 with Windows 8.1 installed. The problem is that when I try to install all Windows updates to update the system, sometimes 30%, restarts and then immediately freezes and goes to a black screen. I can