How to delte empty the paragraph style palette Style group

Hi guys,.

I want to delete my folder empty paragraphStyleGroups that are the Style of Style group 1 and group 3 (see photo) of my palette.

I need a code js for this task.

I have created the script, but it removes all the Style of my Panel group.

Here's the script:

myDoc = app.activeDocument;

myStyleGroup = myDoc.paragraphStyleGroups;

for (p = 0; p < myStyleGroup.length; ++ p)

myStyleGroup [p] .remove ();

Picture 6.png

Please suggest!


Chang

Here's another attempt:

var styleGroup;
var doc = app.activeDocument;
var styleGroups = doc.paragraphStyleGroups;

for (var p = styleGroups.length-1; p >= 0; p--) {
     ProcessGroups(styleGroups[p]);
}

function ProcessGroups(styleGroup) {
     if (styleGroup.allParagraphStyles.length == 0) {
          styleGroup.remove();
          return;
     }
     else if (styleGroup.paragraphStyleGroups.length > 0) {
          for (var g = styleGroup.paragraphStyleGroups.length-1; g >= 0; g--) {
               ProcessGroups(styleGroup.paragraphStyleGroups[g]);
          }
     }
}

Tags: InDesign

Similar Questions

  • How can I customize the paragraph styles in the spreads for left or right side?

    Hi, I use paragraph styles in 2 pages.

    I would have the same paragraph style on a left page to be indented from the left and when the same paragraph is on the right page, it is indented to the right.

    Is it possible to do?

    Very much appreciated.

    Rob

    rob_scozzari wrote:

    Hi, I use paragraph styles in 2 pages.

    I would have the same paragraph style on a left page to be indented from the left and when the same paragraph is on the right page, it is indented to the right.

    Is it possible to do?

    Very much appreciated.

    Rob

    Commercial tools In InDesign plugin reflective objects can do what you want. There is a free trial version, and they respond quickly to questions. It's at: http://in-tools.com/products/plugins/reflective-objects/

    HTH

    Kind regards

    Peter

    _______________________

    Peter gold

    Know-how ProServices

  • How to insert an ellipsis in the paragraph style?

    Hi all

    In the paragraph style, how to insert the selection to the last paragraph symbol.

    Please someone help me solve this problem.

    I have attached the screenshot of the sample. Like that, I have to insert "selection" symbol (three points) in the indesign paragraph style options.

    ellipse.jpg

    Very simple to do this, follow these steps

    1. double click on the paragraph style if you created (if this isn't the case create a new paragraph style, see the image)

    2. in paragraph style options, choose paragraph nets and do all the settings, see the image

    Hope this will help you

    Thank you

  • How to delete, modify or rename/available/imported/defined existing chips and lists numbering in the paragraph style?

    How to rename, delete or change lists in the chips section and numbering in the paragraph Style?

    Screen Shot 2015-05-02 at 13.40.00.png

    Open you select paragraph from the option panel (icon at the top right corner) sets the list (below). Or change the selected list bullet in the bullets & numbering

  • How can I count the appearance of the paragraph style "H1" used in an .indd document?

    How can I count the appearance of the paragraph style "H1" used in an .indd document?

    OS: 10.8

    CS6

    extend the script

    Hello

    must be sth. like...

    pStyleNameToFind = 'Grundtext';;//Your pStylename here
    
    app.findTextPreferences  = app.changeTextPreferences = NothingEnum.NOTHING;
    
    app.findTextPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyles.itemByName(pStyleNameToFind)
    
    var pHits = app.activeDocument.stories.everyItem().paragraphs.everyItem().findText();
    
    var counter = 0;
    for(var i = 0; i < pHits.length; i++)
    {
        if(pHits[i].length != 0) counter = counter +1
        }
    
    app.findTextPreferences  = app.changeTextPreferences = NothingEnum.NOTHING;
    
    alert(counter +  ' of ' + pHits.length + ' paragraphs in active Document are formatted with paragrahstyle ' + pStyleNameToFind)
    
  • How to change the paragraph style to each paragraph that contains only one anchored object?

    Hello

    I have a document in word that should be converted in indesign. The document contains instructions, each step followed by an image.

    I managed to import the document into Indesign and applied a paragraph with numbering style to everything (text, image).

    Now, how do I change the the paragraph style to each paragraph that contains only an image? I need to get rid of the numbering.

    Thanks in advance.

    If the images are all anchored objects, you can use find/replace to find the anchor point and change the paragraph style only once for all paragraphs.

  • How to get the paragraph style menu to detach?

    I wish that the paragraph style menu to behave the way the menu character, that is, as its own independent box. Crazy me a little tied to any "other Panel" - no matter what the name of this Panel, it's that it is attached to.

    Thank you very much!

    Just drag it off the coast in the page.

  • How to set auto resulting in the paragraph style?

    Hello

    I give auto driving the paragraph style. Hux to use 'kTextAttrAutoLeadBoss'.

    Everyone please help.

    Kind regards

    Garza

    Hi Nicolas,.

    in the documentation of IDrawingStyle it says:

    Values less than zero is considered to be 'auto '.

    Hope that helps.

    Markus

  • How can I force a paragraph style without losing the italics?

    This has been annoying me for ages. I work on documents in Word, using italics for book titles, etc. and then import them into indesign. I apply a paragraph style and three out of four times the bits in italics are preserved. However, the fourth time the paragraph style does not (probably due to the presence of italics) and I have to force him to do it using Alt-click. Invariably, the italics is replaced by Roman.

    It happens earlier with a bunch of notes and endnotes in a book, I'm working on and means I have to go back through each of them, manually applying italics to my books and reference titles. Is it possible to force a paragraph of note/reference style without losing the text in italics?

    Thanks for your suggestions,

    Tom.

    I'm not sure that long-term planning is needed here.

    If your only concern loses italics when importing from Word, create,.

    in InDesign, an italic character style. Then do a search and replace

    in the document, InDesign (once you have placed the Word file)

    looking for an italics, formatting and replacing with your italics

    character style.

    Who will save you from losing your italic formatting.

    Repeat for bold, bold italic, exponent, index and nothing else

    the author uses.

    There are scripts that help in this process (I think one of them is

    called "preptext", by Jongware).

    If you want a complete solution that can be found all types of

    override setting in shape and creates and applies the appropriate character

    style, check out my script "create character the Styles of overrides him."

    available on the script on freelancebookdesign.com tab.

    Ariel

  • Balls, created in the paragraph style options in Indesign

    Hi all

    In the paragraph style, how to create bullets before the text and after the text also.

    Please someone help me solve this problem.

    I have attached the screenshot of the sample. Like that, I must create in indesign paragraph style options.

    Capture.JPG

    Thank you...

  • Where is the paragraph style tools in Indesign CC2014?

    Hello! I just started to use IDs through creative cloud on a new computer (using CC CS6 for two years), and the installer gave me rather than CS6 CC2014. So it is a question only on CC2014.

    Where is the window paragraph styles? Specifically, how can I edit, create and organize the paragraph styles, and how do I get a window up on the main screen with all stated styles? All these things were easy to find in CS6, but I can't find them in CC2014. The only thing I get (and with a bit of customization). is a drop-down list on the main toolbar, which allows me to choose from among the existing options on an existing document.

    There is no option of paragraph Windows Styles > Styles.

    There is no option under Type of paragraph Styles.

    The only paragraph window that appears is designed for text editing as you go along, don't not to apply styles.

    Using the options all point me back them to the entrance for CS6 and tell me to go to Type > paragraph Styles (which does not exist).

    I can't get a window up on the main screen to instantly apply styles in a list. I only get this drop, which has no other options.

    Can someone tell me some updated guidance or explain where all paragraph options are and how do I use them? If not, can I go back to CS6? It was easy and intuitive on the front, and now it's not...

    Thank you!

    Nothing has changed on the styles. It's exactly the same thing as CS6. Perhaps you need to restore your preferences.

  • Remove the paragraph style name space

    Hi all

    There is a space character at the end of my paragraph style name.

    How can we delete [space] after the end of the paragraph style name? I don't want to delete [space] if she came between paragraph style names.

    Please provide the js code.

    Thank you

    Tansk

    Please provide the js code.

    Oh sure, you hurry, right?

    You can not call the forum for all the subordinate tasks script? Please? In these six hours you were to twiddle their thumbs and nervously checking the forum every five minutes or so, you could do this by hand.

    Oh whatever:

    for (p=2; p		   
  • Is it possible to change the paragraph style (none)?

    Whenever I make a bulleted list or a numbered list, I get a syle of fonts that we don't use in our project.  I tried to change this style, but it is grayed out.  All other styles allow editing.  How can I change this default style (none)?  I did a search in the file help and on the forum but have not seen any results.  It's too simple or others are ok with this style.

    Thank you

    The choice is to apply other styles like I did, or simply to set your LI style, which is the way of pure HTML. The reason why I do that you cannot map the tag LI for printed documents. I have just started the list, select the style that I want and that's all. It is an extra step.

    What is behind this change is that people complained that the code should be clean and now it is the case, people are aware there is a down side.

    When no style is applied, as zero, the police will be what is defined by the browser. Try changing the default font in your browser for some obscure fonts and generates output. What you'll see is this obscure font. Now see the same output to another browser with a different default font.

    You may not modify any as Willam explained. None means that no style is applied so that applies the default value of the browser. You will see may not be in Arial, the next person may see as something else. Modify a CSS sets styles you include in this CSS. You apply the paragraph styles or you don't, as in no style is applied that in none.

    Clearer now?

    See www.grainge.org for creating tips and RoboHelp

    @petergrainge

  • How can I empty the Windows installation on my hard drive?

    How can I empty the Windows installation on my hard drive, please?  I was going to re - install, then I changed my mind.
    Now, every time that I reboot, instead of launching Windows XP Pro, it try to run Windows installation.  The installation program appears as a second menu item under "Windows XP Pro" on the black screen at launch.

    How can I remove it from the startup screen and flush it out of my system?

    Any correction, automated for this?

    Thank you.

    It is difficult to determine what you did, but the symptoms you describe can be eliminated by editing the boot.ini file (you can also make things really difficult if you make a mistake when you edit the boot.ini file, so be careful).  Will not be "flush out the Windows installation" of your system, but it will stop the menu from appearing at startup time.

    See http://support.microsoft.com/kb/289022

    Your boot.ini file probably has a second line in the [operating systems] section.  Make sure that you delete only the line that points to the installation routine.

  • Graphic object based on the paragraph Style style?

    I just checked the documentation of the API and saw nothing on the point about this.

    Is it possible to write a script that applies a Style object to a jpg image based on the paragraph Style applied to this image jpg online online?

    Hello

    I did the following:

    var curDoc = app.activeDocument;
    
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat= "~a";
    var allFounds = curDoc.findGrep();
    
    for (var i = 0; i < allFounds.length; i++) {
      var curFound = allFounds[i];
      if (curFound.allGraphics.length > 0) {
        var pStyleName = curFound.paragraphs[0].appliedParagraphStyle.name;
        if (pStyleName == "paraStyle") {
          var rect = curFound.rectangles[0];
          rect.appliedObjectStyle = curDoc.objectStyles.itemByName("myStyle");
        }
      }
    }
    

    Kai

Maybe you are looking for