Apply OverprintFill option for all paragraph and character Styles

Hello

How can I request an OverprintFill option in all of paragraph and character styles in javascript. See my code below

jsx. Coding: -.

var mypstyle = app.documents.item (0).paragraphStyles.everyItem () .getElements ();

for (i = 0; i < mypstyle.length; i ++)

{

mypstyle [i] .overprintFill = true;

}

Alert ("Done")

Just change the loop as below:

var mypstyle = app.documents.item (0).paragraphStyles.everyItem () .getElements ();

for (i = 1; i

{

mypstyle [i] .overprintFill = true;

}

Alert ("Done")

Vandy

Tags: InDesign

Similar Questions

  • Add a suffix to all of paragraph and character styles.

    As the title suggests, first of all I would like to add a suffix to all of paragraph and character styles:

    Title 1 = position 1_p

    Bold_p = "BOLD"

    Also, if possible, replace the space with an underscore:

    Title 1 = Heading_1_p

    Chapter No. 1 = Chapter_Heading 1_p

    You're not sure if this need of a script or two?

    Any help would be fantastic.

    See you soon

    Or use code below to replace all spaces with "_".

    For the paragraph Styles:

    myStyles = myDoc.paragraphStyles;

    for (oneStyle = 2; oneStyle)<>

    {

    myStyles [oneStyle] .name = myStyles [oneStyle].name.replace (/ / g, '_') + "_p";

    }

    For character Styles:

    var mycStyleslen = myDoc.characterStyles.length;

    for (a = 1;

    {

    myDoc.characterStyles [a] .name = myDoc.characterStyles [a].name.replace (/ / g, '_') + "_p";

    }

    Shonky

  • CS3: need script to replace spaces with underscores in the paragraph and character style names

    Help! I am very new to scripting.

    I managed to find and tweak existing javascripts to search through all my paragraph styles to disable hyphenation and off balance the jagged lines, but I need help with this one.

    I work on Mac OS 10.4.11 using Indesign CS3.

    I need a script that will search all my paragraph and character styles in my open Active document and replace spaces by underscores.

    Can someone help me with this? It would be greatly appreciated!

    1. I don't know, but I think you can use all the regular GREP inside this function codes. Do not use the quotation marks around of the expression, use slashes! (Why? Just a curiosity of Javascript... maybe a hack that goes back to the gray mist of JS development...)

    This work should - but rather the code above, this is not tested:

    .. Replace (/ [-\ / ()-. _] + / g. '_');

    The GOLD group inbetween the brackets contain all the characters you want to replace with an underscore: the hyphen (this has to be the first character in the group, else it will be interpreted as a range of characters from each side!), space, slash (this one is 'special' inside the function replace JavaScript, so I think he needs to escape with a backslash)! in parentheses, a period (not sure if it should escape - into ordinary GREP, it's the wildcard character for any character, but maybe he loses his magic within a group of GOLD) and finally... the underscore character. Why?

    Well, this replacement string comes with a free bonus. Note the sign after the installment of GOLD +. This means that a whole sequence of these characters is replaced by a simple underscore: "it's / a - / test" will become "This_is_a_test". Adding the underscore line itself to the string of research means that it will also find the whole chain 'space space (stroke underscore)' in 'This style (_)' and, oh magic!, replace it immediately with a single underscore.

    Just FYI, the tiny "g" after the closing slash is abbreviation of 'global', i.e. at the global level, replacing in this string. replace the default values for a replacement only (why? see above...), and adding the 'g' ensures he keeps replacing until it is not find matches more.

    2 see point 1.

    3. uh, yes it's true, but you will need to check very carefully if nothing inside one of these basic models is substituted. You can apply a base style and add substitutions to make look like a subtitle, but that isn't making it a. And to the next paragraph, you can apply a base style and add substitutions to make it look like a paragraph of plain text (etc.). It's a signature of witness to bad formatting...

  • InCopy paragraph and character styles

    Have been upgraded from CS3 to CS5 and our editors have a ton of paragraph and character style pré-séries. I was wondering if there was a way to import these to InCopy CS3 to InCopy CS5. I searched for them in the program files and the folder of application but data had no chance of finding.

    Open paragraph styles menu and choose load all styles. Find the file that has these defined styles.

    Bob

  • Help about the paragraph and character styles scriptting

    Hi all

    I'm working on a project with many files, I change change on all styles of paragraph with multiple processes

    for ex, change the font for all styles of paragraph on all open documents

              var docs = app.documents;  
                     
              for (var d = docs.length-1; d >= 0; d--) {  
                      var doc=docs[d]; 
                      
    var pstyles = doc.allParagraphStyles;  
    for (var a = 1; a < pstyles.length; a++) {    
                              if (pstyles[a].appliedFont.name=="Arial\tBold")    
                                   pstyles[a].appliedFont = "Arial\tBold Italic";    
                         }
                     }
    

    but I found a text inside frames (the locked position) my find/replace a not to apply to this topic

    so, is there anyway to do this process for all chassis from locked position?

    or at least make the lock of the United Nations to all open documents, but I can only do this for the active doc

    app.activeDocument.pageItems.everyItem (.locked = false)

    Another thing, I tried to change it on all styles of character on the files and I wrote the code with my little knowledge script but it seems does not, any hint please?

              var docs = app.documents;  
                     
              for (var d = docs.length-1; d >= 0; d--) {  
                      var doc=docs[d]; 
                      
    var cstyles = doc.allCharacterStyles;  
    for (var a = 1; a < cstyles.length; a++) {    
                              if (cstyles[a].appliedFont.name=="Arial\tBold")    
                                   cstyles[a].appliedFont = "Arial\tBold Italic";  
                         }
    }
             }  
    

    Thanks in advance

    Maybe your consolidated text block... Try this

    docs var = app.documents.

    for (var docs.length - 1; d = d > = 0; d-) {}

    var doc = docs [d];

    var pgItems = doc.allPageItems;

    for (var a = 0;< pgitems.length;="" a++)="">

    If (pgItems [a] instanceof TextFrame) {}

    While (doc.groups.length > 0)

    doc.groups.everyItem () .ungroup ();

    pgItems [a] .locked = false;      }

    }

    }

  • What happens if I don't use paragraph and character Styles?

    I was told that do not use character and paragraph styles makes the files 'unstable '. So everything we manually change is in danger to be changed apparently at random. I have worked in hundreds of InDesign files for several months and have never seen a problem where this is indeed the case. I did a quick search online and on these forums, but I've not found anything directly related to what will happen if the styles have been changed manually. So, what happens if you do not use character and paragraph styles?

    I don't see that there is nothing "unstable" do not use styles, but as mentioned, they make your life easier by providing a single place to make changes that affect all the text containing the tag with the style.

    An important feature/reason for the use of the character styles is that they take precedence over paragraph styles, if a particular word needs to be styled differently to surrounding text, bolded or italicized, for example, you can add a character style that modifies only the bold or italic style type. Subsequent changes to the paragraph style will affect the face and size, if these attributes are changed, but leave your word in bold or italics, bold or italic. If you use "local formatting" (select the word, and apply the formatting) you may lose when styles to change or remove overrides, which is probably the 'random change' you have heard.

    Peter

  • [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 use paragraph and character styles properly?

    I have a document in which the text has two colors (which has no style)

    Black (normal) and Red (to highlight the keywords).

    I needed to put these 2 in a style

    (black) paragraph style

    (red) character style

    Here's my question.

    How can I make sure that when I use the paragraph style, she also uses the style of character but only on the Red words?

    While I need not find/replace every word manually

    I want to do at once.

    If you want to add styles to a document already created:

    (1) create your character style that contains only the color of the characters

    (2) search and replace a text with red color search and replace with the new character style formatting. (Do not type anything in the text portion of the find and Replace dialog box)

    (3) create and apply your paragraph style to all. The text with the applied character Style will stay red.

  • InDesign for Word keeping paragraph and character styles

    Hello

    How can you export an ID document / story in a way that Word will be kept for paragraph styles?

    Is this possible?

    Screen Shot 2016-05-10 at 16.55.26.pngScreen Shot 2016-05-10 at 16.53.30.png

    The screenshots were made by placing the Word document in ID, what I want is the opposite.

    That styles must be created in ID and appear in word.

    Thank you

    Export to RTF Format

  • Print descriptions of paragraph and character Style...

    InDesign: is it STILL possible to print the specifications of type through the character and paragraph Styles?

    You should not! Essential elements for a cool job!

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

  • best judgment for paragraph styles, object styles and character styles

    I want to learn the criteria difference and use of paragraph styles, object styles and character styles. I know how to use them, but know about the best judgment and context, when you use would be better. Can anyone recommend links? I've been using adobe. Please don't suggest books.

    Paragraph styles are whole paragraphs.

    Character styles are letters or isolated words. Do not use the long of an entire paragraph. Do not set all the attributes, only those who are different for the properties of the paragraph Style. Unlike Quark Xpress, in InDesign are character Styles used only for the difference of isolated words.

    Paragraph styles can include the character automatically Style: Styles, GREP, nested Styles, initial letters, chips automatic & numbers and line styles.

    Object styles , set the frame of the object. They include separate definitions of all of the object, the stroke and fill.

    Object styles can also be applied to images in a frame and groups.

    Object styles may also include in the following paragraph Style and a style of paragraphs in automatic way.

    Object styles have several categories, you can choose which category is relevant to apply. For example, it is possible to apply the first style object to give the stroke and fill and apply a different object style to format the corners only and then apply the next. (With this method last only the applied object Style is linked).

    Styles of the opportunity to make global changes in a document. If you build in a smart way, they are a huge time saver. They can be stored in the CC libraries or libraries with objects that are applied to them. If you have created once these styles, you can use them again, and with one or two clicks, you can make their own to new document.

    My recommendation: the habit of Styles, name them always with the same names that it helps you to be accustomed to them and to work faster, much faster.

    There are more models: Table Styles, Styles of cell, the Master Pages and color chart.

  • Dear all, in the follow-up to Massage exhange 2010 there is no option for selective date and time if we want to follow and check the delivery for 2 months mail report, then how, please guide

    Dear all, in the follow-up to Massage exhange 2010 there is no option for selective date and time if we want to follow and check the delivery for 2 months mail report, then how, please guide

    Hi Anandsable,

    The question you have posted is based on Exchange 2010, it is better suited in the Exchange Server forum. Please post your question in the following forum:

    http://social.technet.Microsoft.com/forums/en-us/category/ExchangeServer, exchangeserverlegacy.

    Hope the helps of information.

  • Remove styles of paragraph and character (keep substitutions)

    Hello

    Trying to write a script that will delete all the points and character Styles that are also included in the groups and keep overrides.

    So far:

    //Remove paragraphStyles
    var docs = app.documents.everyItem().getElements();  
    var dl = docs.length;  
    while (dl--)   
        {  
            var parStl = docs[dl].paragraphStyles.everyItem().getElements();  
            var pl = parStl.length;  
            while (pl--) if (parStl[pl].name != "[Basic Paragraph]" && parStl[pl].name != "[No Paragraph Style]") parStl[pl].remove();  
         }
    
    
    //Remove characterStyles
    var chs1 = myDoc.characterStyles.length;    
        for(var j=chs1-1; j>0; j--)
        {    
          myDoc.characterStyles[j].remove();    
        }
    

    After you change the code snippet to remove groups:

    main();
    function main(){
        var targetDoc = app.activeDocument;
        removeAllTypeStyles (targetDoc);
    }
    
    function removeAllTypeStyles (targetDoc) {
        //remove all paragraph styles
        for (var ps = targetDoc.allParagraphStyles.length - 1; ps >= 0; ps--) {
            if (targetDoc.allParagraphStyles[ps].name != "[No Paragraph Style]" && targetDoc.allParagraphStyles[ps].name != "[Basic Paragraph]") {
                targetDoc.allParagraphStyles[ps].remove (targetDoc.paragraphStyles.itemByName ("[No Paragraph Style]"));
            }
        }
        //remove all character styles
        for (var cs = targetDoc.allCharacterStyles.length - 1; cs >= 0; cs--) {
            if (targetDoc.allCharacterStyles[cs].name != "[None]") {
                targetDoc.allCharacterStyles[cs].remove (targetDoc.characterStyles.itemByName ("[None]"));
            }
        }
        //remove all paragraph style groups
        for (var pg = targetDoc.paragraphStyleGroups.length - 1; pg >= 0; pg--) {
            targetDoc.paragraphStyleGroups[pg].remove ();
        }
        //remove all character style groups
        for (var cg = targetDoc.characterStyleGroups.length - 1; cg >= 0; cg--) {
            targetDoc.characterStyleGroups[cg].remove ();
        }
    }
    
  • Best way to clean the paragraph and character catalogs?

    Over the years, I have created a bunch of tags of paragraph and character for different types of documents: novels, technical manuals, etc. For a given document type, I'll use some tags and some don't. For example, a novel will not use numbered steps or sideheads.

    The problem is after years of import for the last tags of a certain type, all files in all chapter books have swelled catalogs, full of tags that are not used and are not applicable for the type of document. I would like to clean these catalogues and let only relevant tags to this kind of document. I'm ready to take the hit if a chapter or book uses a tag that it should not, as long as I know what it is.

    What is the "best practices" way to achieve this? What method do you recommend?

    1. Create a template with the own catalogue file, open each book individually, remove all of the tags file and re - import the template tags?
    2. Create a template with the own catalogue file, and then create new books of the model, copy and paste the text of the original of the files bloated?
    3. Others?

    I understand that the process will be painful, as to clean out her garage. But I'm sick of tripping over all the echoes I have accumulated.

    Thanks for the thoughts and suggestions.

    Ken

    Ken,

    Your #1 approach is probably the best way to go. However, instead of trying to clean up the tags manually, take a look at paragraph of Steve Kubis and character tools. See: http://www.siliconprairiesoftware.com/Products.html

    This will help clean up a lot of things and they are reasonably priced. It also has corresponding tools for the management of cross-references, variables, arrays, and colors that all work you same way. You can try before you buy.

Maybe you are looking for

  • Reporting SERVICES portal does not open with the latest version 30

    Some of my users recently upgraded before us test version 30 and can not enter in the SSRS reporting project. We use SSRS 2008 and 2005.

  • HP ENVY 700-305no desktop PC: Bios update failure.

    Long story short (a little). I got a virus, is a virus really means, crypt all my files, prevents the opening of antivirus programs and redirects the downloads. virus survives 3 reset factory, 3 hard drive formats, and a reinstall of Windows. This le

  • Rotate an image after clicking twice on benchmarks in the photo

    Hello community! I am looking for a solution to rotate an image by clicking on the two reference points on the image. The two pairs of coordinates of the mouse clicking on can give me the angle of rotation with a simple geometry. After this, I turn t

  • cross-platform generates?

    I'm running on Windows 7, but need to create a version of the app for XP. Can someone point me in the right direction for this? Thank you.

  • remove the external hard disk image

    There are on my external hard drive that I would use in a project I am working on photos.  I can find information on how to put photos on an external hard drive, but nothing about deleting the photos in my external hard drive to place and use somewhe