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

Tags: InDesign

Similar Questions

  • [JS InDesign CS3] Style groups, Caprice in colors! (or: how to make the styles of paragraph and character off groups style?)

    Sorry for this question (and my terrible English, incidentally), I'm a javascript noob and I know when I reached my limits.

    Well, I'm taking a set of paragraph and character style groups styles, they are placed in hundreds of InDesign documents (which cannot be regarded as a book). As much as I've tried (thanks to the invaluable help of previous messages in this forum), I was able to move a style to a group and change its position within the group, inside root-level, or between the groups. But it is not matter how I try, I don't know which move reference should I try in case I want to take each style outside the style group and place them after their original level group, folder style [Root].

    I tried:

    var doc=app.activeDocument;
    var pGroups=doc.paragraphStyleGroups;
    
    for (i=pGroups.length-1; i>=0; i--){
         var pStylesInGroup=pGroups[i].paragraphStyles;
         for (j=pStylesInGroup.length-1; j>=0; j--){
    // Here I am, trying to move a style outside the folder that contains it, and failing miserably.
              pStylesInGroup[j].move (LocationOptions.after, pGroups[i]);
         }
    }
    

    He did not, the script has sent an invalid parameter value in the reference field, so I can't use the folder of the group itself as reference.

    Tried (obviously false) alternatives, such as the first available style using as reference. So my second script was

    var doc=app.activeDocument;
    var pStyles=doc.allParagraphStyles;
    var pGroups=doc.paragraphStyleGroups;
    
    for (i=pGroups.length-1; i>=0; i--){
         var pStylesInGroup=pGroups[i].paragraphStyles;
         for (j=pStylesInGroup.length-1; j>=0; j--){
    // Now I try placing the styles after the [Basic Paragraph], that is, the second paragraph style in the document style list 
              pStylesInGroup[j].move (LocationOptions.after, pStyles[1]);
         }
    }
    
    

    It did not work either, another invalid parameter in the reference field. Similar results with my other attempts (I even tried "[Root]" as literal with similar luck).

    So my question is: what command (or script, in case my approach is quite wrong) should I use to accomplish my goal?

    Thanks in advance to those who decide to spend more than a minute thinking about my humble worries and my apologies for some of your lines of code Ripper shamelessly for my purposes.

    Well, tried a few things and I really weird results!

    1. you can move a style within its group.

    2. you can move a style to one group "to" the other, but it will appear "inside" of this style. I got my style of test as a subdivision of [standard paragraph], using index #1. By the index 0 # InDesign ([no paragraph Style]) crashed.

    3. you can duplicate the style, but then you get a copy of the same group. Still no luck.

    4 finally! What is the parent of a paragraph style?

    Document | Request | ParagraphStyleGroup

    'Application' is easy - it's when you do a global style. So, what's the difference between 'Document' and 'paragraphStyleGroup '? Single - well, when you get finally he...

    pStylesInGroup[j].move (LocationOptions.AT_END, doc);
    

    move the style out of the Group and at the end of the list in the document. I don't think it's possible to move directly to a specific position in the main style list - you first need to move a group, then move it around in its own list.

    Fortunately, he returns his new position as a definition once again, if necessary, you can use

    newStyle = pStylesInGroup[j].move (LocationOptions.AT_END, doc);
    newStyle.move (LocationOptions.AFTER, pStyles[1]);
    

    -I haven't really tried this possibility, but it should work.

  • 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

  • [JS] Copy or move the paragraph and character style style

    Hello
    I try to transfer paragraphs a the document to a block a second document but I have hugs the style of paragraph et style character applied.
    I use this command line:


    o.leBlocLegendes.contents = o.leBlocLegendes.contents + leDocument.stories.firstItem().paragraphs[leConteurPara].contents;
    
    


    How do I do not lose anything?

    Thank you


    Original message

    Hello

    I am trying to transfer of the paragraphs in a document to a block of a second document but I loses all the style of paragraph and style of applied character.

    Plug-in this command line:

    o.leBlocLegendes.contents = o.leBlocLegendes.contents + leDocument.stories.firstItem().paragraphs[leConteurPara].contents;
    

    Comment do pay nothing lose?

    Thank you

    Hi Liphou,

    .silence is indeed a property of type string only disregardingly of styles, anchor frames and other animals.

    You prefer the use of object methods and duplicate stories. However styles can be substituted with the target document. If you can load styles before the duplication of the text.

    var main = function() {
        var doc, st, tempDoc, f, tf;
        if (!app.documents.length
            || app.selection.length!=1
            || !app.selection[0].properties.parentStory) {
            alert("You need to select text or text frame");
            return;
        }
    
        doc = app.activeDocument;
    
        if ( !doc.properties.fullName ) {
            alert("Please save file first !");
            return;
        }
    
        st = app.selection[0].parentStory;
        f = File ( doc.fullName );
        tempDoc = app.documents.add();
        tempDoc. importStyles ( ImportFormat.TEXT_STYLES_FORMAT, f, GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE );
    
        tf = tempDoc.textFrames.add();
        st.duplicate(LocationOptions.AT_BEGINNING, tf.insertionPoints[0]);
        tf.fit(FitOptions.FRAME_TO_CONTENT);
    
    }
    
    main();
    

    HTH,

    Loïc

    www.ozalto.com

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

  • Apply the style of paragraph 1 above and the style of paragraph 3 below all paragraphs containing only the italics?

    Hello

    I need a script that can find the paragraphs in italics only glyphs (maybe we can change all that pretty color) and apply the style of paragraph 1 above, the style of paragraph 3 below and this paragraph in italics to paragraph style 2

    Some paragraph of text (for the 1 paragraph style)

    some italic text (for paragraph style 2)

    little text (for the 3 paragraph style)

    After you run the script, I have something like this in 3 styles different points

    a text

    some italic text

    a text

    Lost link!

    /*

    Fixing paragraph style combinations

    Version: 1.2.B

    Script by Thomas Silkjaer

    http://indesigning.NET/

    Minor version b: Bruno Herfst

    + Add any style to replace paragraphs

    + Can cancel

    */

    var the_document = app.documents.item (0);

    Create a list of paragraph styles

    var list_of_paragraph_styles = [];

    var all_paragraph_styles = [];

    the_document.paragraphStyles.everyItem () .name;

    for (i = 0; i< the_document.paragraphstyles.length;="" i++)="">

    list_of_paragraph_styles.push (the_document.paragraphStyles [i]. (Name)

    all_paragraph_styles.push (the_document.paragraphStyles [i]);

    }

    for (i = 0; i< the_document.paragraphstylegroups.length;="" i++)="">

    for (b = 0; b< the_document.paragraphstylegroups[i].paragraphstyles.length;="" b++)="">

    list_of_paragraph_styles.push (the_document.paragraphStyleGroups [i] .name + ' /' + the_document. paragraphStyleGroups [i] .paragraphStyles [i] .name);

    all_paragraph_styles.push (the_document.paragraphStyleGroups [i] .paragraphStyles [i]);

    }

    }

    var list_of_replace_paragraph_styles = list_of_paragraph_styles.slice (0);

    list_of_replace_paragraph_styles.unshift ("[no paragraph style]" "");

    That the dialog box to select the paragraph styles

    var the_dialog = app.dialogs.add ({name: 'Paragraph style pairs Fix'});

    {with (the_dialog.dialogColumns.Add ())}

    {with (dialogRows.Add ())}

    staticTexts.add({staticLabel:"Find:"});)

    }

    {with (borderPanels.Add ())}

    var find_first_paragraph = dropdowns.add ({stringList:list_of_paragraph_styles, selectedIndex:0});})

    staticTexts.add ({staticLabel: "monitoring of"});

    var find_second_paragraph = dropdowns.add ({stringList:list_of_replace_paragraph_styles, selectedIndex:0});})

    }

    {with (dialogRows.Add ())}

    staticTexts.add({staticLabel:"Change:"});)

    }

    {with (borderPanels.Add ())}

    var change_first_paragraph = dropdowns.add ({stringList:list_of_paragraph_styles, selectedIndex:0});})

    staticTexts.add ({staticLabel: "monitoring of"});

    var change_second_paragraph = dropdowns.add ({stringList:list_of_paragraph_styles, selectedIndex:0});})

    }

    }

    {if (the_dialog. Show())}

    Define paragraph styles

    var find_first_paragraph = all_paragraph_styles [find_first_paragraph.selectedIndex];

    anyStyle var = false;

    If (find_second_paragraph. SelectedIndex == 0) {}

    anyStyle = true;

    }

    var find_second_paragraph = all_paragraph_styles [find_second_paragraph.selectedIndex - 1];

    var change_first_paragraph = all_paragraph_styles [change_first_paragraph.selectedIndex];

    var change_second_paragraph = all_paragraph_styles [change_second_paragraph.selectedIndex];

    Set preferences for grep to find to find all the points with the first selected paragraph style

    app.findChangeGrepOptions.includeFootnotes = false;

    app.findChangeGrepOptions.includeHiddenLayers = false;

    app.findChangeGrepOptions.includeLockedLayersForFind = false;

    app.findChangeGrepOptions.includeLockedStoriesForFind = false;

    app.findChangeGrepOptions.includeMasterPages = false;

    app.findGrepPreferences = NothingEnum.nothing;

    app.findGrepPreferences.appliedParagraphStyle = find_first_paragraph;

    app.findGrepPreferences.findWhat = ' $';

    Search current history

    var the_story = app.selection [0] .parentStory;

    var found_paragraphs = the_story.findGrep ();

    var change_first_list = [];

    var change_second_list = [];

    Browse the paragraphs and create a list of words and mark them as index words

    myCounter = 0;

    {}

    try {}

    Create an object to in paragraph reference and the following

    var first_paragraph is found_paragraphs [myCounter].paragraphs.firstItem ();.

    var next_paragraph = first_paragraph.paragraphs [-1] .insertionPoints [-1] .paragraphs [0];

    {if (anyStyle)}

    change_first_list.push (first_paragraph);

    change_second_list.push (next_paragraph);

    } else {}

    Check if the next paragraph is equal to the find_second_paragraph

    if(next_paragraph.appliedParagraphStyle == find_second_paragraph) {}

    change_first_list.push (first_paragraph);

    change_second_list.push (next_paragraph);

    }

    }

    } catch (err) {}

    myCounter ++;

    } While (myCounter<>

    Apply paragraph styles

    myCounter = 0;

    {}

    change_first_list [myCounter] .appliedParagraphStyle = change_first_paragraph;

    change_second_list [myCounter] .appliedParagraphStyle = change_second_paragraph;

    myCounter ++;

    } While (myCounter<>

    Alert ("fact pairs fixation!");

    }

  • Apply to a Style object that defines the style of paragraph and 'paragraph style' to the text block with another block of text?

    I am trying to automate the application of styles in a brochure. Each image has a name, title, telephone, email, city... style paragraph.

    Can I apply an object style that instantly sets the styles of each paragraph. However if I have the linked text boxes, the style of the object does not seem to affect the block of text, or one of the text boxes. Is there a way to get around this?

    I just looked upward: this feature is limited to "simple, smooth text frames."

    I'm sorry.

  • 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

  • How to get all the style of paragraphs and their policies of an indesign file and write all the info with info para in a txt file with scripts

    @

    How to get everyone how to get all the style of paragraphs and their policies of an indesign file and write all the info with info para in a txt file with scriptingstyle and their policies of an indesign file and write all the info with info para in a txt file with scripts

    Hello

    Try this,

    var doc = app.activeDocument,
        pstyles = doc.allParagraphStyles,
        report = "";
    for(var i =0;i
    

    Kind regards

    Cognet

  • Create the style of the selected text paragraph?

    I am trying to create a paragraph style for the selected text in InDesign CS6 (Mac). There must be a simple command for this.

    For example, if I'm in the form of text which has no style paragraph and decide I want to save the formatting as a new style to apply it elsewhere, there is no command for 'create the new style of paragraph selected text'. The only option, seems, is to manually create a new paragraph style, click the style, which of course annihilates all the formatting desired, redo all the formitting (assuming a rememebers it), then right click on the paragraph style and hope that the option "Redefine a Style" is available (which is not often).

    Any guidance greatly appreciated.

    1 Select the text or keep blink, position the cursor on the text and the paragraph open style (press F11), on the paragraph style Panel, click the menu and choose new paragraph Style

    2. in this new paragraph Style dialog box, you can make your desire setting and check the box 'Apply the Style to selection'

    OR

    1. create your text of desire and click on this text created (or select the text) and click on create a new style button that is shown on the image

    2. When you click on create new style from the paragraph style list a paragraph style 1 is displayed but it will not be highlighted, it will highlight on the default style 'Standard paragraph', just click once on the style of paragraph 1 and double-click to rename.

    It will allow to keep the style of what you have created.

    Thank you

  • Paragraph style does not take into account the style options

    I'm changing the style to a paragraph style options in InDesign CS6, but the changes are not applied to text that uses this paragraph style.

    My paragraph style is called copy, and it of Helvetica Neue (TT), size 10 pt and pt 12 leading. I open the window Options of paragraph for the style Style and change the size 8pt and leading him to 9,6 pt; However the text does not change. Even if I save these Options in paragraph Style and then re - open this window again, the window shows the new values. There is also no "+" that displays next to the paragraph style of copy in the paragraph Styles Panel, so it is not substitutions.

    If I replace the style of paragraph copy by manually changing the size and head, the changes are applied to the text, so I don't think that there is a limitation of Helvetica Neue invovled.

    Any idea?

    A common reason for this is that a character style has been applied to the whole paragraph in addition to the paragraph style.

  • Banner image disappears when I move the css to the external style sheet

    If I have the following code in the header of the document, the image of the banner is displayed:

    < link href = "css/styles.css" rel = "stylesheet" type = "text/css" / > "
    < script type = "text/javascript" src = "javascript/copyNote.js" > < / script >

    < style type = "text/css" >
    <!--


    #banner
    {
    margin: 0 auto;
    Width: 980px;
    height: 198px;
    background - image: URL(images/banner.gif);

    }

    ->

    < / style >

    But if I move the code above in the related external stylesheet (css/styles.css), everything appears except the banner image.

    Anyone know what I'm doing wrong?

    BcSurvivor08 wrote:

    the path of the image shouldn't change since the image is still in the folder of the image, right?

    Yes, but the path to the image in the CSS must be relative to the location of the external CSS file.

    In other words, the following rule in the home page

    #banner

    {

    margin: 0 auto;

    Width: 980px;

    height: 198px;

    background - image: URL(images/banner.gif);

    }

    would be written in the external CSS file as

    #banner

    {

    margin: 0 auto;

    Width: 980px;

    height: 198px;

    background-image: url (.. / images/banner.gif);

    }

    because the CSS file is located in the folder css (one level down from the root folder).

    .. / said "in the"css"folder, go up a folder level then find banner.gif in the folder"images"...»

  • Replace the language of the styles in the Style group

    Hi all

    Can anyone help to modify my script so it could also change the styles in the Style group. I tried several times by creating a loop nested under another variable for paragraphStyleGroups but I can't make it work.

    myDoc = app.activeDocument;

    myStyles = myDoc.paragraphStyles;

    myCStyles = myDoc.characterStyles;

    for (i = 1; i < myStyles.length; i ++)

    {

    myStyle = myStyles [i];

    myStyle.appliedLanguage = "Spanish";

    }

    for (i = 1; i < myCStyles.length; i ++)

    {

    myCStyle = myCStyles [i];

    myCStyle.appliedLanguage = "Spanish";

    }

    Your help will be appreciated.

    Thank you

    Kel

    Use allParagraphStyles and allCharacterStyles.

    myStyles = myDoc.allParagraphStyles;

    myCStyles = myDoc.allCharacterStyles;

    Shonky

  • Change the font in the Style Script of paragraph?

    Does anyone know if there is a script to go through paragraph Styles and change the font of the other?

    Also, when it is to reduce the size of police/leader at the same time, or in two separate scripts, which would be sweet utra.

    Thanks to all those who can help in advance.

    littlemookie

    I don't know if there's a script to do this, so one here that I just did to the top. This is assuming you are using CS3 (you don't mention a version), and there are small differences between the versions of ID, so he can't run right now.

    for (var i = 2; I have
    {
    app.activeDocument.paragraphStyles [i] .appliedFont = "Helvetica";
    app.activeDocument.paragraphStyles [i] .pointSize * = 0.80;

    If (app.activeDocument.paragraphStyles [i] .leading! = Leading.AUTO)
    app.activeDocument.paragraphStyles [i] .leading * = 0.80;
    }

    "It ignores the 2 first paragraph styles because those who are"[none]"and [standard paragraph]", and apparently, it's bad karma to mess with those.

    The first line inside the loop simply sets the font. An additional style specifier (for example, 'Normal', 'Bold') is left out because you have something already there. Notice that if you try to change "Helvetica-Bold" for, say, a Frutiger, it will not be correct first time round - Frutiger is not "" BOLD"," it's called "" 65 BOLD"" for this family. Well, you can't all win'em.

    The second line takes the current set point size and multiplies it with 0.80, resulting in a new size of 80% of the previous.

    Lines possible 3rd & 4th first test for a complication. If your leader is set to automatic, you don't have to make it smaller (even worse: JavaScript code tries to multiply Leading.AUTO 0.80 and will be the bomb out with an error). Only when the value to a value fixed, it will reduce to 80%.

  • 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".

Maybe you are looking for

  • Can an HP Photosmart Premium copy to printing on paper of the flat bed scanner?

    Hello Whenever I press the copy on my printer HP Protosmart Premium C410, it will attempt to load to the top of the ADF and won't copy of the flat bed scanner. Is this normal? Can I copy starting from the plateau that I would with books, etc. that do

  • Purchase Wacom Active pen

    If the XPS Duo supports the active pen from Wacom, so where can I buy it? I spent 45 minutes on the phone with a useful Dell salesperson, but without success. Apparently, it's the 332-0102 part can be purchased as an add-on to the latitude of 10. Tha

  • Start a PC mode closed using Task Scheduler

    How can I use the Task Scheduler to start the PC in stop mode? My PC is unable to use wake on LAN as it connects to the internet via wifi due to too far from the router.

  • What Dell switches are suitable for VMware?

    We will have a very simple vSphere environment. What switches should we buy? Must be Dell. I am a newbie in networking, but I'm a PCV. 2 x ESXi hosts in a cluster HA/DRS 5 vCenter Server will run as a virtual machine We will be using VLANs for securi

  • QoS implementationon MCU with conductor and operation

    Hi all We added the MCU to the driver for resilience, but design QoS on MCU is configured on the conductor or MCU? In addition, we would like to discuss about layout MCU control. Based on the advanced driver parameter of model - custom layout, it's a