Remove groups of styles

Hello! I have about 400 Indesign documents that have all of the 29 groups of paragraph style I need is no longer. Is there a way to delete these, as well as of their content, with a script? All style groups a group of corresponding character style that would be fine if it were to be deleted also.

Greetings from Records,

Mikael home

Try this,

var myInddFileList = File.openDialog ("Choose the InDesign files to remove Paragraph Style Group..." , "*.indd", true);
for (var f = 0; f < myInddFileList.length; f++)
{
    var myInddFile = app.open(File(myInddFileList[f]));
    var myDoc = app.activeDocument;
    var myParaGroup = ["paragroup1", "paragroup2"]; //mention your paragraph style group name here
    var myCharGroup = ["chargroup1", "chargroup2"]; //mention your character style group name here

    //Deleting the content of Paragraph Style Group
    for(i=0; i

Vandy

Tags: InDesign

Similar Questions

  • Change language script does not work with groups of styles

    I get documents CS5.5 in which paragraph styles are presented in groups. When I run this script http://forums.adobe.com/message/1913197 , it only works on the paragraph styles that are not in groups of styles. Can someone help me?

    This is because there is a difference in scope between 'paragraphStyles' and 'allParagraphStyles' (lists all paragraph styles (regardless of their group)).

    So changing:

    myStyles=myDoc.paragraphStyles;
    

    TO:

    myStyles=myDoc.allParagraphStyles;
    

    should do the trick (not tested with the script in the linked thread).

    It goes same for section character styles:

    //myStyles=myDoc.characterStyles;
    myStyles=myDoc.allCharacterStyles;
    

    Uwe

  • In a group of styles paragraph style

    How you refer to a paragraph style that is part of a group of styles?

    Here's the script:

    FRM.paragraphs [0] .appliedParagraphStyle = "Title";

    But the problem is that the "Title" style into a group called "headings" ' so, how should I do for him? "

    Thank you.

    Hello
    When paragraphStyles in paragraphStyleGroup, parent of paragraphStyles is paragraphStyleGroup.
    apply styles as below:

    var pStyleGroup = app.activeDocument.paragraphStyleGroups.itemByName ('Headings');
    titleStyle var = pStyleGroup.paragraphStyles.itemByName ('Title')
    FRM.paragraphs [0] .appliedParagraphStyle = titleStyle;

    Ten

  • Synchronizing groups P-Style?

    Hi all!

    I have a book (.indb) which contains 10 chapters (10 files, .indd). After a rough layout of the chapters, I went ahead and gathered all my styles p in one of the chapters. When I went to sync 'book', it took all the styles p I placed into groups and put them outside their perspective folders. She also did not create and/or transport on these records of group for the other chapters.

    Is it possible to synchronize groups p-style through all the chapters so that they are compatible? Any help is appreciated. Thank you!

    ~ Erick

    It would be the "master of the Style. There is a box to the left of each document indicates which document you want to push out of the styles in the. Looks like a document with three lines to other documents.

  • remove groups

    Hello

    I have 805 groups in my data, and in some cases, there are less then 805 groups (for example, 801).

    now, I have a script to remove all groups except the first group.

    My problem is:

    If my data is only 801 groups, the script stops and say (I use an invalid value: permitted are the values form 0 to groupcount)

    How can I solve this problem?

    Here is the script I use for this:

    number = 2
    for gruppe = number of 809
    do
    Number = number + 1
    If zahl<= 809="">
    Call GroupDel (gruppe)
    Call msglinedisp ("delete the Group Nr." + str (number))
    end if
    loop until (number > 809)

    hope someone can help.

    Thank you

    Hi portas,

    Why don't you write something like this:

    I have Sun

    for i = 2 to groupcount
    Call GroupDel (groupcount)
    Call msglinedisp ("delete the Group Nr." + str (groupcount))
    Next

    Regrads,

    Philipp K.

    AE | NOR-Germany

  • Remove group policy that blocks USB

    I have a group policy that is configured to block access to removable devices for all users. There is a group in Active Directory (2008 R2) that users can be put to block access to the policy and a policy that allows the removable devices. When users are in the group, the registry is changed so that they should have access, but when they try to access a CD or USB drive, they get "access denied".

    The policy to block (and allow) access is by using Configuration of user - political - administrative templates - system - removable storage access. I "CD and DVD: deny read access", "CD and DVD: deny write access", "floppy drives: deny read access", "Floppy Drives: deny write access", "removable disks: deny read access ', ' removable disks: deny write access", "all removable storage classes: refuse access to all the", "Ribbon devices: deny Read access", "Ribbon devices: deny Write access", "WPD devices." ": deny Read access ' and ' WPD Devices: deny Write access.

    On the strategy of blocking, all who are set to enabled and the policy to allow it, all are set to disabled. If the user is allowed access after that be denied that they are always refused on their main computer. If they log on another computer, it works.

    Why the police work as it should?

    Hello Kevin,

    Thank you for visiting Microsoft Community and we provide a detailed description of the issue.

    According to the description, I understand that the problem with Group Policy delete that blocks USB into the computer.

    Certainly, I understand your concern and will try my best to help you.

    To get more information about it, we have a dedicated forum where these issues are dealt with and would be better suited to the TechNet community.

    Please visit the link below to find a community that will provide the best support.

    https://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    I hope this information is useful.

    Please let us know if you need more help, we will be happy to help you.

    Thank you.

  • remove the component style

    I use the date picker 8 Javafx. Its works fine. I've defined a style sheet for my application, and in this stylesheet, I have a button style. I apply this style to the entire scene.

    Now my question is: when I use the date picker and I click on the calendar icon, the datepicker popup appears and the left and right arrows bordering fields month and year in the seems to choose the style of the button class of stylesheet defined in my app., is there a way to avoid this and say datepicker to use default styles and styles not defined my request.

    I tried to remove the style when running from the scene, but of no use. Any help?

    Thank you

    Try to copy all the information from modena.css to something, like .date-picker button {} to 'substitute' General button class.

  • Disable / remove / change a style Cufon

    I am currently working on the default product page in Business Catalyst and need to disable or change the styling for the H1 tag Cufon. When the product page is rendered, it adds the Cufon style to the header tag, but I did not understand where to edit this block of code, or where to turn it off.

    Any help would be greatly appreciated.

    Thank you.

    Sam

    Ok. So for those of you have found your way here hoping to find the solution, you're in luck! I was able to successfully remove cufon from my business catalyst site. First of all, to do this, it is unnecessary to download your entire website via FTP and use an IDE to find instances of cufon, because I did it for you

    There are two files where cufon to get his evil power:

    1. /JS/jQuery.main.js
    2. /styles/all.CSS

    In Business Catalyst, go to the 'Develop' tab then locate and open the folder 'js' to the file 'jquery.main.js '. Each of the following cufon comment as follows. By adding / / at the beginning of a line, you change it in a comment, so it is rendered at run time. You can also wrap multiple lines with to comment on several lines.

    Examples:

    initCufon();

    or

    / * initCufon(); */

    Assuming that you have not changed the file 'jquery.main.js' of origin in the past, here's where to look:

    • Add line 6 / / before initCufon();
    • Wrap lines 18, 19 and 20 with / * and * /-where initCufon function is defined
    • Add line 45 / / before initCufon();
    • Add line 69 / / before initCufon();
    • At the bottom of the script adds / / at the beginning of lines 438 and 440

    Once you said the above lines, Cufon is effectively disabled, but the style still exists. To change the style, open the 'all.css' in the folder "styles".

    1. Place the cursor anywhere in the script of css and press "CTRL + F" on your keyboard. a line of research will appear at the top of the script.
    2. Type "cufon" (without the quotes) and press ENTER. Whenever you press on enter, it will change to the next instance found.
    3. When I changed my style, I ecapsulated each instance of cufon, I found in to remove disable it. Essentially, you could just delete them, but I like to keep the original code, just in case I need to solve the problems later.

    For example:

    . CUFON-active .header-Panel ul li {line-height: 24 PX ;}}

    became

    . Header-Panel ul li {line-height: 24 PX ;}}

    or

    . Header ul li a {line-height: 24 PX ;}}

    I hope this helps anyone with the same problem. I would add that after I disabled Cufon in the "jquery.main.js", I had to fix my main navigation menu style.

  • Remove unused paragraph Styles - without basedOn styles

    Hi all

    I have remove the unused paragraph style, re-flow the pattern content also deleted "basedOn" style.

    How to avoid remove basedOn styles.

    Example here:

    1. I have not used the '06 extract"style of paragraph directly in paragraphs (texts), so it's the unused paragraph style.

    2. I applied "06 extract 1 P" style of paragraph directly in paragraphs (texts), but connected the pstyle "06 extract" to indirectly ' 06 1 P "(avec l'option basedOn) see below excerpt.". "

    Removing unused styles, the "06" excerpt has also removed and affects '06 extract 1 P. So, re-flow occurring in this document, how to avoid this? No need to remove by using the 'basedOn' styles (example: "06 extract").

    Screen shot 2015-10-12 at 3.27.12 PM.png

    myDoc var = app.activeDocument;

    var myParStyles = myDoc.paragraphStyles;

    var myCharStyles = myDoc.characterStyles;

    for (I = myParStyles.length - 1; i > = 2; i--) {}

    removeUnusedParaStyle (myParStyles [i])

    }

    for (I = myCharStyles.length - 1; i > = 2; i--) {}

    removeUnusedCharStyle (myCharStyles [i])

    }

    function removeUnusedParaStyle (myPaStyle) {}

    app.findTextPreferences = NothingEnum.nothing;

    app.changeTextPreferences = NothingEnum.nothing;

    app.findTextPreferences.appliedParagraphStyle = myPaStyle;

    var myFoundStyles = myDoc.findText ();

    If (myFoundStyles == 0) {}

    myPaStyle.remove ();

    }

    app.findTextPreferences = NothingEnum.nothing;

    app.changeTextPreferences = NothingEnum.nothing;

    }

    function removeUnusedCharStyle (myChStyle) {}

    app.findTextPreferences = NothingEnum.nothing;

    app.changeTextPreferences = NothingEnum.nothing;

    app.findTextPreferences.appliedCharacterStyle = myChStyle;

    var myFoundStyles = myDoc.findText ();

    If (myFoundStyles == 0) {}

    myChStyle.remove ();

    }

    app.findTextPreferences = NothingEnum.nothing;

    app.changeTextPreferences = NothingEnum.nothing;

    }

    Thank you in advance,

    Dev

    before checking if the paragraph style is in use, check if all other models are based on it. something on the lines of (warning code, bad, inefficient to come):

    for (i = myParStyles.length - 1; i >= 2; i--) {
        for (var z = 0; z < myDoc.allParagraphStyles.length; z++) {
            var goodToRemove = true;
            if (myDoc.allParagraphStyles[z].basedOn == myParaStyles[i]) {
                //mark the parastyle as not to remove
                goodToRemove = false;
                break;
            }
        }
        if (goodToRemove) {
            removeUnusedParaStyle(myParStyles[i]);
        }
    }
    
  • 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

  • How to remove a basedOn style without losing the bet in shape

    I have a problem that I solved in my case, but I wonder if there is a cleaner solution. I have a function that removes the basedOn of a paragraph style or a character style that is passed. I thought that it worked, but it came to my attention that the character styles were losing their formatting when their basedOn style has been deleted (in fact, the value '[No Style character]'). Set the style basedOn the "[None]" style has the same effect. I also tried to create a dummy no style and use it as my base, same effect. When you do this through InDesign UI, the formatting is preserved, so I think it's a bug. My solution has been to create a new character style, all properties of the first style (except basedOn and properties) copy on it, delete the original style (replace with the new style), and then rename the new style to match the old. Far as I can tell it works, but it seems exaggerated. Does anyone have a better suggestion or hint?

    Here is the code that causes the problem:

    function unBaseStyle(funcSty){
        //Current style name.
        var myStyName = funcSty.name;
        //If the style is surrounded in brackets it is a default InDesign style and should not be unbased. In that case, skips to next style.
        if (myStyName.lastIndexOf("[", 0)  != -1) {return false;}
        else{
            var myBaseStyName = funcSty.basedOn.name;
            //Checks that the base style isn't undefined (which would indicate that it is already [No ... Style] and also that it isn't bracketed.
            if (myBaseStyName == undefined || myBaseStyName.lastIndexOf("[", 0)  != -1) {return false;}
            else{
                //If the style is a paragraph style, bases it on [No Paragraph Style].
                if (funcSty instanceof ParagraphStyle){funcSty.basedOn = "[No Paragraph Style]";}
                //If the style is a character style, bases it on [No Character Style].
    //--->This is the line that causes the problem. funcDoc.characterStyles("None") has the same effect.
                else{funcSty.basedOn = "[No Character Style]";}
                return true;
            }
        }
    }
    

    Here is my code to work:

    function unBaseStyle(funcDoc, funcSty){
        //Current style name.
        var myStyName = funcSty.name;
        //If the style is surrounded in brackets it is a default InDesign style and should not be unbased. In that case, skips to next style.
        if (myStyName.lastIndexOf("[", 0)  != -1) {return false;}
        else{
            var myBaseStyName = funcSty.basedOn.name;
            //Checks that the base style isn't undefined (which would indicate that it is already [No ... Style] and also that it isn't bracketed.
            if (myBaseStyName == undefined || myBaseStyName.lastIndexOf("[", 0)  != -1) {return false;}
            else{
                //If the style is a paragraph style, bases it on [No Paragraph Style].
                if (funcSty instanceof ParagraphStyle){funcSty.basedOn = "[No Paragraph Style]";}
                //If the style is a character style, bases it on [No Character Style].
                    else{
                        var funcStyName = funcSty.name;
                        var newSty = funcDoc.characterStyles.add(funcStyName + " basedOnCopy");
                        var p
                        for (p in funcSty){
                            if (funcSty.hasOwnProperty(p) && p != "basedOn" && p != "properties"){
    //-->This copies over the properties; wrapped in try/catch because some properties are read-only.
                                try{newSty[p] = funcSty[p];}catch(e){}}
                        }
                        funcSty.remove(newSty);
                        newSty.name = funcStyName;
                return true;
            }
        }
    }
    

    Am I missing something or is my solution more or less the way forward?

    Hi cchimi,

    Easily check if a style property is inherited is a question open for me

    Perhaps our fellow Scripting Guys have some ideas on this point.

    In regards to your routine of rewriting from scratch , a better approach (although not fully tested) may be:

    function unBaseStyle(/*ParagraphStyle|CharacterStyle*/sty)
    {
        var o = sty.properties;
        if( !o.hasOwnProperty('basedOn') || 0 <= o.name.indexOf('[') ) return;
        o.basedOn = "$ID/None";
        sty.properties = o;
    }
    

    @+

    Marc

  • Remove group request simultaneous program

    Hello

    By mistake, I added the simultaneous program to the group asked, is it possible to remove it?

    Thank you.

    Go to the form groups of application-> query for the request group

    Place the cursor on the simultaneous program you want to delete and click the delete icon (icon 'X' of red color in the toolbar) and save the record

    -Jay

  • How Referance groups paragraph Style in the Code?

    How reference to a paragraph in style Group before a paragraph style in the code? My "Heading 1" paragraph style is in a group, called "headings".

    myStyle = app.activeDocument.paragraphStyles.item("Heading 1");
    myStyle.appliedFont = "Microsoft JhengHei";
    
    

    Region Capture.png

    Richard:

    I build a large number of files Indesign containing the tag text, and this is an example of what I am at the beginning of the line when the style is located in a group.  The style name is "AGBoldCtr" and it is located in the group "xSports."

    American League

    In the code, I create a variable for a style to a group like this:

    var PPHead = app.activeDocument.paragraphStyleGroups.item("xSports").paragraphStyles.item ("AGPPHead");

    Then, I attribute PPHead variable of a paragraph as in:

    app.activeDocument.selection [0] .paragraphs [iLoop] .appliedParagraphStyle = PPHead;      //

    Dick Conrad

  • CSS - how to remove/change the styles for a single image?

    Hello

    In my CSS, I have the following rule which images in the div "main_text" with a border, background color and padding of the styles:

    #main_text img {}
    border: 1px solid #666;
    padding: 5px;
    background-color: #C0BEB6;
    }

    However, I have an image on a page where I want to remove this style and I can't find a way to do it.

    I tried to apply a class to the image I want to change:

    {.exclaim}
    border-style: none;
    float: left;
    margin-right: 10px;
    padding: 0px;
    }

    The rule of .exclaim appears after "img #main_text" in the style sheet.

    The float and the margin that both work, but the border and fill are retained other selector.

    I know that I could just have 2 classes and apply them as needed but finally I'm likely to have images everywhere on the site requiring the border and fill and just one that isn't.

    The site in question is here: http://www.elitejoiners-Shopfitters.co.UK/

    The page that contains the image that has no need of the border is the error page: http://www.elitejoiners-Shopfitters.co.UK/Error404.html

    Thank you

    Mick

    . Exclaim will always be inside the #main_text?

    If so, increase the 'weight' of .exclaim CSS by addressing specifically so that it outweighs #main_text img:

    change

    {.exclaim}
    border-style: none;
    float: left;
    margin-right: 10px;
    padding: 0px;
    }

    TO

    #main_text .exclaim {}
    border-style: none;
    float: left;
    margin-right: 10px;
    padding: 0px;
    }

  • FindChangeByList script question, re: when a style is part of a group of style

    Hello

    I use script FindChangeByList InDesign and run into a problem.

    Here's the line of problem:

    grep {findWhat:"^."} {appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Text").paragraphStyles.item("Body2.TextIndent"), changeConditionsMode:1919250519} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true} //Change everything to Text.indent2 style

    What I'm trying to do, it's each paragraph in shape with the style called "Body2.TextIndent" which is in my style sheets in a group called "text".

    This line does not work for me; I get a JavaScript "Error #17.". Error string: the variable name expected. »

    Please note that I CAN get this line to work just fine if I use a style that is NOT in a group. For example, this line works very well for me:

    grep {findWhat:"^."} {appliedParagraphStyle:"Body2.TextIndent", changeConditionsMode:1919250519} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true} //Change everything to Text.indent2 style

    The problem is apparently that the FindChangeByList script does not like style groups. I found it by internet Google and found this link:

    http://www.listsearch.com/InDesign/thread/index.Lasso?17986

    Can anyone help?

    Thank you.

    What version of InDesign are you using?

    The following line works for me on CS3, Mac.

    grep     {findWhat:"^."}     {appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Text").paragraphStyles.item("Body2.TextIndent")}     {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true}     //Change everything to Text.indent2 style
    

    Kasyan

Maybe you are looking for

  • Cannot send, Outlook Express, but can receive

    I can't send, but can receive e-mails with any problem.  My ISP & I spent an hour working with COMCAST on 3 POP and SMTP scenarios and they said that I had was AOK. They said I had to contact Ms.Has anyone had and solved this problem? I get the follo

  • race fix it solution stop PC

    While the race mount computer solutions DC/AC to dwn b4 finishing solutions & now does not work when it reloaded

  • How to recover data from scratched CD

    Original title: I want a software to recover the data of cd__ I created a cd by direct use of the windows cd creater and now it is scratched. you want a software to recover data from the cd...

  • R61 HARD Ultrabay drive adapter

    ThinkPad R61 - 8934F9U (a) I travel a lot and want to install a 2nd HARD drive in the Ultrabay slot. In my view, that R61 has Ultrabay Enhanced, which is 12.5 mm in height. Should which adapter I buy? This will void the warranty? Lenovo Web site has

  • Windows 7 causing Audio & Microphone to stop working

    I have a Sony Vaio VGN-Z21WN, which came with Windows Vista.  I later upgraded to Windows 7 Ultimate. In recent weeks, the audio doesn't work with the microphone.  I tried to install the drivers more late two Sony & Realtek Web sites, but nothing wor