How to add paragraph styles in mychange

Hi all

In the coding here is a lot to find and change. Now, I need mychange an extra change more with S2, i.e. one of the paragraph style applied. Please advice and see my code below.

var myfind = ["(<display>)(.+)(</display>)", "(<verse>)(.+)(</verse>)"]


var mychange = ["$2", "$2"]


for (k=0; k<myfind.length; k++)
{
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findChangeGrepOptions.includeMasterPages = false;
    app.findGrepPreferences.findWhat = myfind[k];
    app.changeGrepPreferences.changeTo = mychange[k];
    app.activeDocument.changeGrep();
}

Kind regards

Assia

Hope that I misunderstood your question, try this

myFindChange('()(.+)()', '$2', 'display');
myFindChange('()(.+)()', '$2', 'verse');  

function myFindChange (findWhat, changeTo, paraStyle){
     app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.nothing;
     if(findWhat)app.findGrepPreferences.findWhat = findWhat;
     if(changeTo)app.changeGrepPreferences.changeTo = changeTo;
     if(paraStyle)app.changeGrepPreferences.appliedParagraphStyle = paraStyle;
    app.activeDocument.changeGrep();
     app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.nothing;
}

Vandy

Tags: InDesign

Similar Questions

  • How to remove paragraph styles select only

    Hi friends,

    How to remove paragraph styles select only

    Example:

    CO_H3

    COCPN

    COINT1

    COINTT

    Line of credit

    Head of design issues

    Design A-Head Mtrs

    Design Mtrs Hd

    EOC-nl-listitem

    Literate EOU continued

    Thank you

    Hi Karthik,

    Please try this code

    indesign #target

    var allStyles = app.activeDocument.paragraphStyles;

    var total = allStyles.length;

    var arrPosition = 2;

    myInput ();

    myInput () function

    {

    var myParStylesList = app.activeDocument.paragraphStyles.everyItem () .name

    var w = new window ('dialogue', ' ParagraphStyles applied: ");

    var myInputGroup1 = w.add ("group");

    myInputGroup1.add ('statictext', undefined, ' paragraph style: ");

    myInputGroup1.alignment = 'left ';

    var myDropdown1 = myInputGroup1.add ('dropdownlist', undefined, myParStylesList);

    myDropdown1.selection = 1;

    var myButtonGroup = w.add ("group");

    myButtonGroup.alignment = 'right ';

    myButtonGroup.add ('button', undefined, 'OK');

    myButtonGroup.add ('button', undefined, 'Cancel');

    w.Show ();

    r = [myDropdown1.selection.text];

    for (i = 2; I have<>

    {

    If (allStyles [i] .name is r)

    {

    allStyles [i] .remove ();

    Return r;

    }

    on the other

    {

    arrPosition + 1

    }

    }

    }

    Kind regards

    Barry B.

  • How to use paragraph styles?

    Can someone explain how to use paragraph Styles? OMG! This is so difficult for me to kiss - I can't seem to understand how to create a paragraph style in a document, in the first place, then I don't seem to be able to apply it to the rest of paragraphs in the document.  Whenever I have try this I lose the track and then I lose patience!

    I do appreciate this forum and hope someone can clarify this issue for me, I am eternally grateful. I'm trying to gather some my illustrations and story in a booklet for children and I need to get out to publishers (fingers crossed!) until I forget why I started to be a student in graphic design and Illustration in the first place

    Thank you!

    aganess wrote:

    Can someone explain how to use paragraph Styles? OMG! This is so difficult for me to kiss - I can't seem to understand how to create a paragraph style in a document, in the first place, then I don't seem to be able to apply it to the rest of paragraphs in the document.  Whenever I have try this I lose the track and then I lose patience!

    I do appreciate this forum and hope someone can clarify this issue for me, I am eternally grateful. I'm trying to gather some my illustrations and story in a booklet for children and I need to get out to publishers (fingers crossed!) until I forget why I started to be a student in graphic design and Illustration in the first place

    Thank you!

    I've been there. It was a long time ago, but I still remember the confusion and despair.

    First, know that you will survive and ask what was the hang up. If you are a special person, do you promise never to forget what was the hang up, then you can help others when it is time to pay back the community.

    Think about how things work without paragraph styles. When you want a paragraph to look a certain way, regardless of the software you have used to work with text, you select ("highlight") some text and look for ways to style it (check its appearance, or 'attributes' or 'features' or 'features'.) You choose a font (Helvetica, Times, etc.) weight ("BOLD", extra bold, light), a color of text, an angle (italic, Roman), the space between the lines ("leading,") space between paragraphs (space before, space after,) and so on. Without named styles, you must select each property in a menu or a list when the text is selected. The next time that you want this same paragraph look, you can recall everything you did and repeat with newly selected text, or you can copy and paste one that looks, then change the text inside.

    However, it does take long to realize that he has to be a way to save these settings and pull them up and slap them on the other selections, with a few clicks and make sure that you don't forget to do something. Creation and registration of collection of a paragraph of the property settings are called "define a style." Software for manipulation of more modern text can save paragraph styles that apply to full paragraphs, and they can also save character styles, which apply to parts of the text in a paragraph. A paragraph of normal text can be used a style called 'body '. You can select a bunch of miscellaneously style paragraphs and apply the body style for them with a single click on the paragraph styles list.

    If you decide that you would like the body to look different style, you can redefine, and all paragraphs in the active document using the body style change to show the look of the new definition.

    In a body paragraph, you can have same bold italic bold text and italictext and so on. You can always select text in a paragraph and find a menu that offers characters bold or italic in the selected text. But you can also create a character for each of these apparitions style and apply them to music. As for paragraph styles, character styles are more controllable and more useful than simply highlight and apply a property. If, you use a character style that applies "BOLD", you can change its character style definition and all the places it is used in a document will show the change.

    Here is an example which shows the usefulness of the styles of characters named:

    According to the standard style for writing guides that have been developed before computers, scientific names, the words of the foreign language in a host as the English language, the titles of the documents, movies and poems and a few other things are supposed to be italicized. With character styles, you can create and apply styles of characters for each category of text in italics. In this forum, * sapiens, The Pentagon Papers and Gone With the Wind, all look the same, but with character styles, styles, named 'scientificName', 'bookTitle', and 'filmTitle', can distinguish between texts in italics. Sometimes, you gotta be able to treat these things differently, and styles is a way to keep them organized.

    Most writing tools can create a style named for the existing sample. So, if you have customized a paragraph for your body text, you can use InDesign to set the body of the paragraph in the example chosen style.

    Google search for terms like 'InDesign create the paragraph of the selection style,' "InDesign redefine style', 'Create a character style, InDesign' and"InDesign tutorial character and paragraph styles."

    HTH

    Kind regards

    Peter

    _______________________

    Peter gold

    Know-how ProServices

  • 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 add the style of java script?

    I would add some kind of alert style to this java script so that if 'required' fields are not informed or selected when the form is submitted, this part of the form is alerted with a red star like that, *

    I put one of the fields below with the relevant java script. Can someone please help me achieve this?


    < select name = "figure" class = "productButton" id = "figure" >

    < option value = "0" > - Select model - < / option >

    < option value = '7031' > Tropical Green Granite with bronze figurine sacred heart as on the photo (& pound; 7031) < / option >

    < option value = '5216' > Tropical Green Granite with bronze effect figure Sacred Heart (& pound; 5216) < / option >

    < option value = '5216' > Tropical Green Granite with figurine restored MF122 (& pound; 5216) < / option >

    < / select >


    <!-VALIDATE-> ORDER FORM

    < script type = "text/javascript" >

    <!--

    function RequiredFormFields() {}

    inform the customer to provide choices of figurine

    var model = document.forms.product.figurine.value;

    If (document.forms.product.figurine.selectedIndex == 0)

    {

    Alert ("Please indicate choice of miniature");

    Returns false;

    }

    } / / end of function

    ->

    < /script >


    OK, it's a bit more complicated but here go us:

    
    
    
    Test
    
    
    
        
        

    Characters remaining:

    You cannot type anything beyond the characters. Note If you select the first entry in the drop-down list, nothing happens? Because the number of characters of registration exceeds the character max relies on its own

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • Problem affecting the existing paragraph style

    Hi all!

    I have searched all morning and can't find a lot of good documentation on the use of existing scripts paragraph styles to HAVE. I know that you can build a live, but more specifically, I want to add in the tabs and don't see this as an option to add paragraph styles in one of the refs to javascript.

    I do an "export log" that captures the version, date, time, artist name/layers assigned to help our team of quality control. My problem is that any new text added to the box ignores existing paragraph styles, and I do not see so he can apply what I have in the file.

    I can find the style, so I don't know it exists, and I can also draw the text box, so I think that these paths are correct and working, it's just the applyTo seemingly does not. Here is my code below:

    //get the textBox with the sign off content
    exportLogText = docRef.textFrames.getByName("RT_Signoff");
    //add the sign off text
    exportLogText.contents += "v. " + versionLetter + "\t" + theDate + "\t" + timeStamp + "\tExport by: " + username + "\tLayers: " + layersExported;
    exportLogText.contents += "\r"
    //identify the "Export_Log" paragraph style that already exists in the AI doc
    var paraStyle = docRef.paragraphStyles.getByName("Export_Log");
    for (ps = 0; ps < exportLogText.paragraphs.length; ps++){
        paraStyle.applyTo(exportLogText.paragraphs[ps], true);
    }
    redraw();
    
    

    Once it hits the applyTo line, the script stops. I found similar posts claiming this code should work, so I don't know what I'm missing! Any help is appreciated.

    I found a similar code here:a paragraph style for blocks of text in the document

    It's really a matter of aesthetics, but I can't stand the text to look like this:

    issue1.PNG

    When he could look like this!

    issue2.PNG

    Looks like it was a problem with my file which was causing the anomaly, not the script. Things seem to be working now! Thanks for the input guys!

  • created in Chapter 1 paragraph styles cannot be chosen for the other chapters

    HI. Now I have all my "paragraph styles" determined for my ebook. Thanks again for the advice saved me after that I lost so much time.

    New > book > book1

    New > doc > click

    Add > doc > Table of contents for book1 [which is the table of contents in the print version]

    Add > doc > Chapter 1

    Click table of contents to make master and select it.

    layout > toc [add paragraph styles used in chapter1] save the style as tocbook1 [deselected replace existing toc]

    Click on + to add next chapter 2 [this is now selected and I can see all the paragraph styles]

    - but when I double click to open Chapter 2

    -only ' standard paragraph + ", 'normal' 'reference text' and 'paragraph 1' style are available."

    more information:

    as I entered in each of the chapters in this book with a good table of contents (finally)

    -I can't select text > paragraph style > and see p-styles listed in Chapter1: chapterheading, chaptersubdescription, chaptersubtitle, paragraphspacing, dialogue...

    notes that can be useful with this diagnosis:

    I came across a major messup of "loading" styles p "all".  It sounded like a good idea.  It worked again but this time I just load them all rather than things deselection.  I don't have an idea of what I've done here, but

    result: all my notes were listed in the TOC navigation panel resulting in the .epub that was readable in adobe reader digital.

    what I ended up doing:

    After experimenting a ton - I was still unable to fix this problem which postponed in each table of contents that I tried to build from scratch, so I was just remove almost all "indesign books', indesigndocs that have been tocs and epub files.

    AGAIN, any help would be greatly appreciated.  I'm ready to roll if you know what I mean.

    Thank you

    I don't understand what you're trying to do.

    You say that you did not have your paragraph styles in the rest of your chapters?

    They are like this:

    Book1

    Chapter 1 (this does have styles p)

    Chapter 2 (it doesn't)

    Chapter 3 (does not)

    If this is the case then you must synchronize all what you styles p.

    Do this, use in designating what chapter to take information from by clicking on the first chapter in the small box left in the book window and then click the drop down menu on the window of your book

    go to the stync options select styles p and c

    then book Sync, this will fill the remaining chapters with the styles that are in the first chapter.

    you will need to open each chapter separately and apply the relevant styles to the paragraphs.

  • Redefine paragraph in list of instances styles: how to add script?

    My config: CS6 Mac + ID

    Hello

    I have a history with a list of paragraph, each being a pure instance of a paragraph style:

    paragraph 1 in style1

    paragraph 2 of style2

    paragraph 3 in style3

    etc.

    I want to do a paragraph case by hand on these paragraphs and then redefine each style based on my edits.

    I know how to do it, step by step, with command of UI style "redefine".

    Is it possible to do in one step of javascript? (I looked in Jongware list a command similar to "Redefine" javascript but I didn ' found)

    Any ideas?

    TIA

    Best regards

    Nicolas

    Hello

    Try changing the line 6

    if (app.menus[108].menuItems[3].enabled) app.menus[108].menuItems[3].associatedMenuAction.invoke();
    

    Jarek

  • How to chain add all styles of only certain page paragraph style

    paragraph style (A1style) by the 'Like', I want to add

    myDoc var = app.activeDocument;

    var myParaStyle = "A1style";

    for (p = 0; p < app.activeDocument.pages.length; p ++)

    {

    for (t = 0; t < app.activeDocument.pages [p].textFrames.length; t ++)

    {

    app.activeDocument.pages [f] .textFrames [t] .insertionPoints [0] .silence = "like."

    If (executives of related texts [t] .appliedParagraphStyle == myParaStyle) {}

    }

    }

    }

    Hello

    Hope this is your requirement,

    app.findGrepPreferences = app.changeGrepPreferences = null;
    
    app.findGrepPreferences.appliedParagraphStyle = "A1style"
    
    app.findGrepPreferences.findWhat = ".+";
    
    app.changeGrepPreferences.changeTo = "LIKE $0"
    
    app.activeDocument.changeGrep();
    

    Another way,

    var myParas = app.activeDocument.stories.everyItem().paragraphs.everyItem().getElements();
    
    alert(myParas.length)
    
    for(i=0; i
    

    Concerning

    Siraj

  • Add the tab character before the content of particular paragraph style

    I have to add the tab character before the content of particular paragraph style

    app.findTextPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyles.item ("IDX2");

    list = app.activeDocument.findText ();

    // 2. For each found the point...

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

    {

    App.Select (list [i])

    App.Selection[0].insertionPoints[0].contents="\t".

    }

    But the code above only works in the first instance. But I must add the tab character all the content of the paragraph applied

    How to do this

    Hello

    Another way without GREP...

    var doc = app.activeDocument;
    var myStories=doc.stories;
    var J= myStories.length;
    
    while( J-- ){
        var mStorie = myStories[J];
        var K= mStorie.paragraphs.length
        while( K-- ){
            if  (mStorie.paragraphs[K].appliedParagraphStyle.name == "toto") {
                mStorie.paragraphs[K].contents= "\t" + mStorie.paragraphs[K].contents;
            }
         }
    }
    
  • Paragraph styles - how will I know they are working on my site... So they can inherit Business catalyst (blog)?

    I created my site in Muse and adding a business catalyst blog module.

    I created my paragraph styles and added code to the modulestylesheet.css.

    Why the blog is not read the typekit fonts?

    How can I know muse renders fonts correctly?

    Any thoughts would be appreciated,

    Darren

    Hi Darren,

    This article is a bit outdated in terms of the UI, but the main steps are the same. Typekit fonts must be added manually as Typekit requires you to add some JavaScript and CSS code.

    If you do not publish a version of the site, and I'd be happy to take a look. You can leave us a message of support to: [email protected].

    See you soon,.

    Benjamin

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

  • Assign paragraph styles to xml tags correctly. How?

    Hello


    I want to assign xml tags to paragraph styles in InDesign CS6 on a Mac 10.6.8. The XML itself is organized as follows:


    <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? >

    < catalog >

    < article id '32434' = >

    "< img href="/bilder/32434.tiff "/ >

    < artikeltextgruppe >

    < artikelmarke > DieselGabana < / artikelmarke >

    < artikelheadline > super Jeans ist < / artikelheadline >

    < artikeltext > Superjeans knallt kidney. < / artikeltext > < number > 70238 < / weight >

    < artikelmaterial > 100% Jeans < / artikelmaterial >

    < artikelgroesse > UK < / artikelgroesse >

    < artikelfarbe > UK < / artikelfarbe >

    < / artikeltextgruppe >

    < / product >

    < / katalog >


    By selecting the option "Assign formats by name to the tags' (translated from the German), I wanted to create the desired look. But if I start all I get is the entire < artikeltextgruppe > textblock assigned to 1 formatstyle. And not to mention that the whole content of < artikeltextgruppe > resembles a single paragraph without any structure (no line breaks) the content is properly structured, because I can highlight the value of e.g. < artikelmarke > separately by doubleclicking the tag in the structure view.


    (a) what can I do to assign formats correctly AND to have correct line breaks?

    "(b) if I drag my node < img href="/bilder/32434.tiff "/ > iin the layout, I get a message posted to search again for the location of the correct reference. And this happens independently on the use of the relative or absolute references (even if I need to use those on) what can I do here?

    Thank you very much

    First of all, I have probably do a search and replace to remove the group element with a text editor ( and elements). They aren't really necessary.

    Secondly, I usually create my styles with the same names as the items themselves. Then, after the XML is imported, I use the command "map tags to styles" in the Structure pane.

    I copied and pasted the single article element to create 4 folders, added a change to an image for each record of the item. Once the paragraph styles have been mapped, your XML looked like this in form of two columns (to get all 4 records on a page)...

    By default, ID creates a single line to a single line in the XML file. So if you want to be on their own line of the elements, the XML must be formatted like this. If you need a different style within a paragraph, you create character styles and edit the items in a group of XML and or paragraph and add the code in the XML file accordingly or post-processing once inside the code.

    I still need to take the XML I gives me and reformat, moves with the tree items, change the links to the images, delete tabs and or spaces where I do not want, tag character styles, etc., to be closer to how I want the original format to be.

    Mike

  • How to insert bullets in the middle of a paragraph style?

    For my business, I create auto-generated CVs. Due to the limitations of the program used to automatically generate the CV, I can only use a paragraph style nested throughout the entire document. That's what I would like to a paragraph style to look like:

    COMMERCIAL:

    Clinic OVO, Montreal (Quebec)

    • Renovation of the clinic, 2008

    Role: Project Manager

    Merck, Kirkland (Quebec)

    • Building 5, 7 & 8 - existing office renovation & expansion, 20 04

    • Building 18 - new building project, 2001

    Role: Project Manager

    I know how to insert a hyphen at the beginning of a paragraph style, but how indicate I want chips to start on the 3rd line of the paragraph and stop 2-the last line of the paragraph?

    You will need to enter manually. Styles cannot add text, only format.

    Automated bullets are only accessible to the general public for the start of a paragraph and cannot apply to the middle. You can use find/replace to add, possibly, but it doesn't look like me you have a model that is sufficiently well defined to do any sort of work of automation.

  • How to create the paragraph style

    Hi guys

    We create a teaching manual in line with the definitions in the glossary. Our advertising design definitions are indented text and a colored bar on the left hand side to highlight the definition. The bar should automatically resize if the text wraps to a new line. We cannot think of a way to create this as an object or paragraph style in Indesign CS5. We would appreciate really a few ideas on how to do

    InDesign has unfortunately no feature to allow a rule to scale depending on the height of a paragraph. You could use a very short, very thick section NET and a style for each length of line for your definitions. This will mean proofing text in order to ensure the right model is used throughout. The text, the width of the column or the editing style can easily cause the number of lines to change in several paragraphs, proofing will be crucial. This method will also depend on the width of a coherent column. If the width of the column varies somewhat, new styles will be necessary.

    You can also use a picture for your definitions. Add a column beside the column of main text for bars, makes it as close as you want the bars to be, then fill it with the color of the line. That the text grows or shrinks, the line height is more or less narrow, forcing the line to keep to the desired height. Place text will be more difficult that way, but adjourned for lengths of line won't be necessary.

Maybe you are looking for

  • How to recover the Satellite L to get back on Vista?

    Hiya, My son has recovered a part a little Trojan, it only would not let us go in safe mode or restore. The only thing we could do was to completely clear all & use the disks to reinstall again. Simple normally... but this time it wont run something

  • MacBook Air very slowly. How to fix.

    Hello.. I want to know why my Mac Book Air running slow? Already clear partition and install again. Any app or software installed. All new OS does X no DATA. But very slow. What is the problem? My camera; MacBook Air > CPU = Intel Core 2 Duo > 2 GB 1

  • Windows Media works is not uk yorkshire September 2011.

    Windows media Center for us give all the channels of DTT and overland. We got it with a 'win tv' plugged into the computer. We gradually channels, first BBC, now lost everything. Help, please. I tried your suggestion that I found online Open Media Ce

  • The script files are corrupted in vista on my computer laptop r61i

    Technical support of McAfee said that my scripts files are corrupted in vista on my computer r61i laptop... How can I download and replace on a preinstalled OS * original title - scripts to repair files in thinkpad r61i of vista preinstalled v

  • Unknown network Vista problem

    Just hooked up new wireless modem.  2 of the 3 laptops excellent work and we have Vista.  The third does not connect.  In terms of network, there is a red X between the network and the world.  The network is labeled 'Unidentified network' update WiFi