Delete paragraph styles in the style groups

Hello!

I have 30 + paragraph style groups that all contain the paragraph style "Fotobyline". Is there a way to remove this style in all groups of style with a script?

Thanks in advance.

Mikael home

Try now,

var doc = app.activeDocument;

var pstyles = doc.paragraphStyleGroups;

for (var i = 0; i)<>

{

If (pstyles [i].paragraphStyles.Item ("Fotobyline"). IsValid)

{

pstyles [i].paragraphStyles.Item ("Fotobyline"). Remove()

}

}

Kind regards

Cognet

Tags: InDesign

Similar Questions

  • Problem deleting paragraph styles

    I have a book with five documents inside. I am trying to remove the paragraph styles, but they won't go away. I continue to remove them from one of the documents, can I make the source of the document style, to synchronize other documents with her, and styles keep reappear. I tried to do with different documents, but I always get the same result.

    Synchronization book removes the styles only adds.

    Simply open each file (only 5 of them) and dissolving styles... they are used somewhere in the darkness.

  • Count the unused paragraph styles

    I want to check InDesign documents my students to see if they have been neatly with their style sheets. I have a script that works partially (I think this would work in CS4, if you replace CS4 CS5).

    The bit that does not try to save the styles within groups. I commented in the script to display the error section. I get the error:

    "Invalid value for the set property" applied paragraph style". "Planned to string, the style section or anything, but will put \"body text (body). " "number 30477

    I tried to put the name of the style and the group, because that's how it works if you do it manually, IE body text (body). But it does not work.

    Any help would be appreciated.

    property myTypeReport: ' " - makes available anywhere.
    " game of myTypeReport to '" - prevents report becomes cumulative when running several times.
    Tell application "Adobe InDesign CS5"
    the value myDocument to rating 1
    game of unusedStyles to "'
    game of myFoundItems to "'

    game myDescription to "unused paragraph styles"
    the value myParagraphStyleGroups for each paragraph style group of myDocument
    the value myParagraphStyles for each paragraph style of myDocument

    Repeat with I have a 3 in (County of myParagraphStyles)
    define myStyle to the the point i of myParagraphStyles name
    the value find text preferences for Nothing
    the value text preferences to change anything
    the value applied paragraph style to find text preferences to myStyle
    tell myDocument
    the value myFoundItems to find text
    if (account myFoundItems) = 0 then the value unusedStyles to (unusedStyles + 1).
    end say
    end Repeat

    -This is the section of the error
    Repeat with x 1 to the number of myParagraphStyleGroups
    set myGroup to the of the point x of myParagraphStyleGroups name
    the value myParagraphStyles for this entire paragraph styles to paragraph style group myGroup of myDocument
    Repeat with I have from 1 to (count of myParagraphStyles)


    game of myStyle to (name of point i of myParagraphStyles) & "(" & myGroup & "") " string "
    -Returns the myStyle
    the value find text preferences for Nothing
    the value text preferences to change anything
    the value applied paragraph style to find text preferences to myStyle
    tell myDocument
    the value myFoundItems to find text
    if (account myFoundItems) = 0 then the value unusedStyles to (unusedStyles + 1).
    end say
    end Repeat
    end Repeat
    -finish the section error

    "myReport game to "(" & unusedStyles & "")" " & "\t\t" & myDescription
    if (County unusedStyles) > 0 then the value myTypeReport to myTypeReport & myReport and return
    return myTypeReport
    end say

    Can you make best use of all styles of paragraph in your document instead of styles of paragraph of the document, which should access the independent styles of groups? You would have to give on the name using as reference (probably a good thing anyway) and use the style itself (in your find/replace).

  • [AS] [CS3] script find/repalace with style groups

    Hello world

    I've been struggling with this problem for a while and hope someone can enlighten us.

    I'm trying to use applescript to run a series of queries to search and replace.

    For example:

    Tell application "Adobe InDesign CS3"
    paragraph style applied to find the value of "Text" text preferences
    font style to find value text preferences 'italic book '.
    style character applied to change the value text preferences 'italic book '.
    tell document 1
    change the text
    tell the end
    tell the end

    This works great except if the document contains styles within groups of styles, in which case, I get an error saying

    "Adobe InDesign CS3 has been an error: invalid value for the set of"applied paragraph style"property."

    String, style section or anything, but received the "text". »

    If you do the find/replace manually, the paragraph style text (hand) indicating that the text is inside the hand of the style group.

    How can I specify it in the script?

    Thank you!

    InDesign is forgiving if you specify your style just in name, but in the case of groups of styles, be more specific.

    Tell application "Adobe InDesign CS4"

    -paragraph style applied to find the value of "Text" text preferences

    the value applied paragraph style to find text preferences for the paragraph style "Text" of the paragraph style group 'Hand' of the active document

    end say

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

  • 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]);
              }
         }
    }
    
  • [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.

  • Maintaining in the Group paragraph styles

    I have a flyer that runs vertically, from left to right. I have 3 styles of paragraph for the title.

    If there is no room for THE 3 styles of paragraph at the bottom of the text box is there a way to force them to move to the next text box WITHOUT moving the text box that they sit in?

    Thank you

    Steve

    In the paragraph for each paragraph Style - select sequence Options and choose "keep with next paragraph".

    This should force paragraphs to always stay together.

  • Remove the imported chips and replace them by paragraph Style

    I imported a large number of documents to PDF and I need to remove the text format for the numbering of lettering and balls and replace them with paragraph styles. I find it difficult to arrive at a text or grep search and replace for it.

    So far I managed to assign bullets paragraph style, but I can't seem to remove the imported point. This is my poor attempt a search and replace. I guess it's possible to do it also for lettering and numbering?

    Screen Shot 2016-04-20 at 15.06.36.png

    and that's what it looks like after the change with the ball remaining.

    Screen Shot 2016-04-20 at 15.13.17.png

    Good question! Can anyone chime in with the 1-step process, but it is darn fast than two, especially if you save the first query:

    • Search: Bullet tab
    • Change of: Para style balls
    • All changes

    • Click on the trash can to delete the paragraph style
    • All changes

    Fact.

    With GREP, you might find one or several characters followed in a tab at the beginning of a paragraph (^. + ^ t) to locate any list, but you would need to set the style of bullets to bullets, the style of numbering of numbers and the AlphaNumbering style to the letters, so I don't see a benefit.

  • How can I move pages from one document to the other without merger of paragraph styles?

    I want to create a singular indesign file of 2 separate documents, which allows me to make an interactive PDF of it.

    However, when you move pages from one to the other, it seems that when each document has a paragraph style with the same name, they merge. The problem is that text is then adjusted if the styles do not match completely.

    Is there a way to merge the documents without any formatting changes?

    Create a Style group in each document and move all styles in this file. Give each document a different name. Do it with all kinds of styles: paragraph, character, objects, tables and Cell Styles. Then you can sort them later in the merged document what you do with these styles.

  • The font color do not apply on a paragraph style

    Hello

    I try to change color on a paragraph style, and it won't change. I try another color, another paper, same thing. So, it's a software problem. Not a file. I delete InDesign and re-install. I fix the permission with disk utility and Cocktail. I restart the computer. I have reset PRAM.  I run the last ID CC 2014 on Yosemite. No problem since the update. Do you have a solution for me? Thank you in advance.

    capture 2015-02-12 à 13.38.10.JPG

    If you select the entire title is an applied character style? The character style must be set to [none]. What you are showing can also occur via a style nested inside the paragraph style.

  • How can I edit a paragraph style in the Muse?

    Is it possible to change a font or other details in a paragraph in Muse style sheet? I tried to reproduce the style, and then, when I delete an old, I replace it with a new one. Is there a more direct way to do?

    Hello

    If you create a paragraph style, and then change to any attribute, the style has a substitution. If you want to keep this substitution and redefine style click the button to "redefine the selected style of attributes" (highlighted in the screenshot).

    More info is here:

    http://helpx.Adobe.com/Muse/using/creating-using-character-paragraph-styles.html

  • Apply the paragraph style to a glyph and not the glyph displayed?

    I have a large Word document I have to mark up with different paragraph styles. Fortunately the data contains different glyphs for specific text strings, and so I might have the styles of paragraph kick in when he meets the glyph. But ultimately, I need to remove the glyphs when I go to print, and therefore the style will be deleted also.

    I wonder if it is possible to change the glyph to some kind og hidden state. I could mess with the x position of the text string, but I'm not not to keen on this solution. Someone has an idea?

    You must use 'GREP', not 'text', in the Find/Replace window!

Maybe you are looking for

  • Impossible to install addons Web error page?

    Hello I am trying to install addons, but I have the looks that I can't do, because of the format of the page... Please take a look at this image: http://i.imgur.com/Nu2sKkH.PNG?1 He always kept showing up like this and im not sure what to do really,

  • I use Firefox 4.01 and there is no FIREFOX button in the upper right corner of the browser. This is supposed to be a novelty, but it isn't there?

    I've just updated to firefox 4.01. In the new features page, it shows a FIREFOX button and a new look to the page with more new features... However, my browser updated resembles the old with no new features. I've updated two computers with the same r

  • Insteument automation Basics

    I am pretty new to instrument control, after reading online content it is the things that I have collected. 1. you can connect to any instrument that supports IEEE 488 GPIB 2. you can connect to instrumrnt via GPIB, USB, and Ethernet (provided that i

  • Perhaps a BIOS need help problem

    So I have problems with my computer now and days where it crashes / blue screens, and he will give me options to try to recover my PC since the last accident, when I try to choose another option of recovering the BIOS itself it freezes my computer in

  • No sound when you access radio online

    Original title: SUSSU (unchanged Situation, always screwed up) Still no word of radiomarma.com and folkradio.ge as to what's going on with these two stations... You have problems with programs Error messages Recent changes to your computer What you h