remove the grep in paragraph styles

Hello

I added grep styles to my para styles:

for (var i = 1; i < myParaStyles.length; i ++) {}

var myGrepStyles is myParaStyles [i].nestedGrepStyles.add ();.

myGrepStyles.grepExpression = '. '. (?=»)";

myGrepStyles.appliedCharacterStyle = myDoc.characterStyles.itemByName ("Stylename");

}

in a new version, I have to get rid of these grep styles. Replacing the stylename with "[None]" does not, and removing the style isn't a solution either, as it could is used somewhere else.

any ideas?

Thanx

You can remove GREP styles:

myParagraphStyle.nestedGrepStyles [0] .remove ();

If there are two or more GREP styles in a paragraph style, loop through them.

Peter

Tags: InDesign

Similar Questions

  • Remove the shortcut of paragraph Styles

    Hi all

    Is it possible to remove the paragraph with script styles shortcut.

    Thank you

    Shonky

    It is not listed in ESTK help, who suggests that 'no '.

  • Script for grep that looks for the B of paragraph style paragraph style

    Hello

    I am fairly new to scripting in Indesign, and I ran across something I want script that I do not know how. Among the paragraph styles that are in our files are Normal and song. I need to add an extra paragraph return between all instances of normal followed by a song. I tried to search the forums to see if what was already here somewhere, and if it is I didn't come through it. I want to implement in the form of script grep, but if anyone has another way to do it, I would like to know also.

    Thanks in advance

    Hello

    For example, you can use a script.

    I guess a block of text with a correct history is selected and the history is in a setting or related frameworks.

    ....

    monarticle = app.selection [0] .parentStory;

    If (myStory.constructor.name! == 'Story')

    {

    Alert (' select a destination text block, then try to pls\rand ");

    Exit();

    }

    myNormal = app.activeDocument.paragraphStyles.item ("Normal");

    mySong = app.activeDocument.paragraphStyles.item ("Song");

    app.findTextPreferences = null;

    app.findTextPreferences.appliedParagraphStyle = mySong;

    mFound = myStory.findText ();

    Len = mFound.length - 1;

    If (len > = 0)

    While (len)-

    {

    currPara = .paragraphs mFound [len] [0];

    If (.appliedParagraphStyle myStory.paragraphs.previousItem (currPara) is myNormal)

    currPara.insertionPoints [0] .silence = "\r";

    }

    ...

    Rgds

  • How to change the weight of the contours with paragraph styles digitally in Illustrator CS6 (Mac)?

    Hi all

    I have to define hierarchical weight in my paragraph style of - say - 12 pt. How to handle that? I can only choose from a predefined list, which is insufficient.

    illustrator-cs6-outline.png

    He used to work in CS4, as you can see in the following screenshot.

    illustrator-cs4-outline.png

    In addition, I work with Mac, and I was told that this "bug" is not produced on Windows... No matter what Apple autour user, who can help me here?

    Thank you

    Simon

    Same thing is happening here.

    However, you can first create a type with a run of 12 points, then define a new style of paragraph, and although she says 10pt apply 12pt.

    If you have not watched in graphic styles, which may be a better option for stokes. You can

    • Move the fill on top of the race (allows you to use a different color for the race, so the Moose of the doe of type sahep can not get crushed)
    • Use several surrounding type traits
    • Set the corner options for rounding

    For appearance & graphic style, the secret to type must first define your background of type and outline to none (this removes the stylization to the level of the character), then apply the contours and funds in the appearance palette at the level of the type only. In this way the stylisation to fight each other.

  • Search the text of paragraph style and place them in the new text block with width 50mm

    Hello

    I'm looking for voor a paragraph to find script dat styles and place them in a new text block with width 50 mm.

    Is there a solution?

    Kind regards

    Patrick

    Width: options General of the frame of the text, GBA: fixed width, then 50mm width

    Height: automatic block text size options

    (These two in the dialog box object styles)

  • Add the prefix by increasing the order in paragraph styles

    Hi all

    Can we add prefix according to ascending order in the paragraph styles.

    As

    01 style 1

    02 style 2

    03 style 3

    04 style 4

    Please pass the code

    Thank you

    LUN

    var parStyle, number;
    var doc = app.activeDocument;
    var parStyles = doc.paragraphStyles;
    for (var i = 0; i < parStyles.length; i++) {
         parStyle = parStyles[i];
         number = parStyle.name.match(/\d+$/);
         if (number != null) {
              parStyle.name = zeroPad(number[0], 2) + " " + parStyle.name;
         }
    }
    
    function zeroPad(num, digit) {
         var tmp = num.toString();
         while (tmp.length < digit) {
              tmp = '0' + tmp;
         }
         return tmp;
    }
    
  • [JS CS4] Add menu item to the context menu of the control panel paragraph styles

    Hi all

    I am trying to add a menu item in the context menu of control panel of the paragraph styles, that appears when you right click on any paragraph style name in the Panel. But I can't find the menu in app.menus.

    In app.menus there is, for example, a 'Menu of the Pages panel framework', 'object Styles point context Menu. But there is no similar menu for the paragraph or character style.

    Someone help me?

    Paul

    RtMenuStyleListItem

  • Using GREP InDesign paragraph Style

    I'm still stuck... I wrote with success the GREP command to search for all instances of the Dollar and percentage out of the States within a body of text that looks like this: ((\$\d+((ea|pk|pr|set|\s|$))) | () \d+\ % DISCOUNT))

    But I don't want the formatting to occur if the Word save precede the statement of Dollar, see my screenshot.
    Screen shot 2011-05-13 at 2.28.40 PM.png
    Now, I tried to paste only the statement above in a negative lookbehind statement but I just cannot operate unless I specifically address the above text as: \$30(?<!) Save \$30)--permutation the \$30 with ((\$\d+((ea|pk|pr|set|\s|$))) | () \d+\ % DISCOUNT)) it breaks completely.

    You almost had it!

    Yes, Lookbehind negative is the key - but you must put in place. The postanalyse "starting to work" to the position that you insert in the match string, if during your first attempt

    \$30 (?.)

    It is first that he finds the "$ 30" and then--from the end of this string-, he looks back to see if it matches to "save $30"... it tests ' $30 ' against 'Save'. "". " Put the postanalyse 'Save' at the beginning it will work like this:

    (?

  • Unformattable Indesign text - how to remove the spaces between paragraphs?

    I have a 95 page indesign document. I have a few unwanted spaces between paragraphs. I could not get rid of these spaces. I tried to replace the formatting, using the window styles to paragraph, but in this case indesign does not yet recognize the formatting. I put paragraphs in form to 0P0 before and after paragraphs, and yet space remains between some paragraphs. I'm going crazy!

    The problem lies in the text imported into strange formatt, but that was five years ago and I don't even have access to the original text to try to import once more. Perhaps because it is a document to Indesign c5 and c6 now I use?

    Any help appreciated with gratitude,

    Sam

    After checking the object applied to blocks of text style: text frame JWK it shows under text frame General Options/Vertical Justification/Align/Justify (Peter Spier mentioned above about this possibility). I would put this Align/Top. Also when you changed the paragraph to align on the grid he left some gaps on some pages. I have put that back in would line up on the starting grid. There will be a reshuffle of the text when you do. To check if everything looks as it should. Make a copy of the file and make your changes there just in case, and let us know how it goes.

  • Changing the names of paragraph style

    I asked this question a month ago, but I did ' t really ask him just.

    I get InDesign to InDesign6 documents. In the process, we change the style names to make things future compabile makes all the spaces. periods, dashes, etc.

    Thus, for example, title 1 becomes Heading_1 in Page No. -left becomes PageNo_Left, etc. Easy, just do one or two documents by hand, but I literally desgines of the documents that are going to need it.

    So, I'm looking to write a script to automate this process, more or less. I think I need something like:

    App.documents [0].paragraphStyle.Item ("Heading 1"). Name = "Heading_1".

    App.documents [0].paragraphStyle.Item (page no. - Left). Name = "PageNo_Left".

    etc.

    Am I headed in the right direction? Any advice would be greatly appreciated.

    Figured it out. Script is:

    app.activeDocument.paragraphStyles.item("Heading_1").name = "Heading_1".

    app.activeDocument.paragraphStyles.item("Page_No.-Left").name = "PageNo_Left".

  • 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");
    

    (^/)

  • 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]:

  • 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}

  • Cannot find the paragraph styles

    When I create a table, the text style sometimes as "Table Style 2" in paragraph styles section but but when I click on the triangle to the list of different styles, he is nowhere to be seen. "" I'm new on this so sorry if it's something obvious but is there more models on the list of those that appear immediately and if yes how do for them?

    Using Pages on El Capitan 10.11.1 v5.6.1. When I insert a new table, the Table Style 2 paragraph Style is visible in the text: Style tab. Click on the triangle produces a rollout with the list of paragraph Styles. I can't reproduce the problem you describe.

  • Move the style Group paragraph styles

    Hello

    I want to spend the paragraph styles of Group of paragraph style to the paragraph style palette.  I use the code to do so below.  Styles of the style group is moved outwards but on display inside the style group. All the elements of paragraph style are no name moved style return.  He took the last paragraph style in the style group.

    test (App.activeDocument.paragraphStyleGroups);

    Alert (app.activeDocument.paragraphStyles.length + "-" + app.activeDocument.paragraphStyles.everyItem () .name)

    function test (PPMs)

    {

    try {}

    for (var i = sGrp.length - 1; i > = 0; i--)

    {

    cstyleGrp = PRGS [i];

    for (var j = cstyleGrp.paragraphStyles.length - 1; j > = 0; j-)

    {

    var cstylGrpStyle = cstyleGrp.paragraphStyles [j];

    cstylGrpStyle.move (LocationOptions.AT_END, app.activeDocument.paragraphStyles [app.activeDocument.paragraphStyles.length - 1]);

    cstylGrpStyle.move (LocationOptions.AT_END, null);

    cstylGrpStyle.move (LocationOptions.AFTER, app.activeDocument.paragraphStyles [0]);

    }

    If (cstyleGrp.paragraphStyleGroups.Length > 0)

    {

    test (cstyleGrp.paragraphStyleGroups);

    }

    }

    } catch (e) {}

    }

    Screen shot 2015-07-07 at 2.02.08 PM.png

    Screen shot 2015-07-07 at 2.02.26 PM.png

    You can get the behavior very buggy if you aren't careful with moving paragraph styles!

    Either way, the right way to move from a paragraph style is like this (you will need to edit the code below as well as p becomes a reference to a real paragraph style):

    d = app.activeDocument;

    p = / * some paragraph style in a group of para-style * /.

    The following line move p in paragraph style out of his group and in the list of paragraph styles in the document d

    p.Move (LocationOptions.UNKNOWN, d);

    HTH

Maybe you are looking for