Police applied paragraph style

Hello

The paragraph contains more than a fontstyle.  If I use the code below, its name to return a single style police.

Alert (app.selection [0] .fontStyle)

How can I get all the style applied paragraph font?

Thanks in advance,

Sudha K

Hello

Try this...

alert(app.selection[0].textStyleRanges.everyItem().fontStyle);

Concerning

Tags: InDesign

Similar Questions

  • How to avoid overwriting the italics when you apply paragraph styles?

    First of all, let me say thank you to the community of Adobe's Forum for the great help over the years! You Rock! 9 times out of 10 you nail!

    OK, so I have a long document full of italics, bold and accents. Successfully, I imported the text in MS Word and kept these text features using the import options. But now, when I go to apply paragraph styles, the italics are lost. Is it possible to implement paragraph styles so that they maintain Roman, italic, bold and also special characters like accents? Thank you!

    Hi David: I just put upward (and record) queries for search/replace that I of course after you import all text. For example, I have one that is italic in the document and it goes to a character called italic style. Once I saved queries, it is very fast to run on all the stories at the same time. And once the local formatting is managed through character styles, it is intact by assigning paragraph styles.

    ~ Barb

  • InDesign CC 2015 (do not apply paragraph styles)

    Hello

    InDesign doesn't apply paragraph styles. Said she, but nothing has changed. Someone else has the same problem?

    Thank you

    Have you looked to see that a character Style is accidentally applied on the same text? Character styles replaces the paragraph style attributes.

  • Use GREP to apply paragraph styles, character styles not only

    I have a body of text, and in it, I would like to apply a specific style to the paragraphs corresponding to a model. I did a GREP style that applied some changes formatting of paragraphs, I tried that it affects, but in doing so, I found that I couldn't Center these lines using a character style. (The corresponding lines should be centered, and the rest should be left aligned.)

    I was thrilled to learn that the GREP function, then completely disappointed with this limitation. InDesign offers the possibility to automate this, so I must not cross and Center each paragraph corresponding to the hand?

    Thank you!

    InDesign provides a way to automate this so?

    Yes and no. There is no dynamically linked paragraph styles to a paragraph about his boss, but he has at least two alternatives:

    (1) use Grep-F/C

    (2) use the script FindChangeByList or MultiFindChange which is basically automate operations F/C

    HTH

    Loïc

  • Not applying paragraph styles does not correctly

    I don't know even how to describe this problem except that... weird.

    For example: I put a style particular to 21 PT 22 PT. leading. When I apply this style to a paragraph, it sets the text to 42/44 - twice as big. Even with a heading style. I updated PT. 41 and it comes out to pt 82. It does this for all my styles. The '+' is not appear on any of them, this isn't a matter of substitution.

    Has anyone else seen elsewhere? I'm getting nowhere attempting this nail.

    TIA

    The text has been transformed? This will mess up the paragraph styles. Do not apply to the size of the game. The paragraph style will be applied, but then the transformation will also be applied.

  • Table of content not applying paragraph styles do not

    Hello

    Intensely frustrated, but assuming that I have do just something stupid I can't understand.  I use CS4.

    Try to make a table of contents.  Everything will import correctly in the table of contents - I because of paragraph styles to the different levels, I've wanted to, etc., including some of the hidden layers.  All these import correctly.

    I did the paragraph styles for the real KNOCK out and filled in the box for each to apply to the specifc level.  The basic indentation formatting etc. I am applying work, but features and the font size will not change.

    When I look at each paragraph style, everything entered in the way that I want it to be (that is, text formatting, etc.).  I can go to my OCD manually and click on the section of text and apply the style to the paragraph I want and apply the recesses, etc., but the formatting of the text is not.  I have to go to character styles to make it work.

    If I go into another section of my document, apply that same paragraph text style, then all (characteristics of fonts & renfonçait changes etc.).

    Looks like you can have styles of characters applied to text in the document itself, and these character styles are preserved. Local formatting and character styles applied in the paragraphs are retained when you make the table of contents.

    Many users doesn't seem to understand the distinction between character and paragraph styles, too and using character styles incorrectly. I'm not saying that it's true for you, necessarily, but you should undersand this character styles are used to change the font attributes for bit isolated from the text in a paragraph. The basis for the type specification is part of the paragraph style, and there should be no reason to apply a style of character with the exception of special cases - some words or characters - in the paragraph. Text most will have no style applied character.

  • InDesign CC - not to apply paragraph style specified typekit fonts

    All the other attributes in the style of paragraph are applied, but the police remains the same.

    Substitutions of compensation makes no difference. Police remains the same, even though the style that I am applying a different font (Museo without).

    Looking for a style of applied character.

  • Paragraph style > apply... then next > keyboard shortcut?

    Hi all

    I am trying to create a keyboard shortcut for:

    "Apply (paragraph style name) then next.

    But can seem to find it in the options keyboard shortcuts window.

    I usually get to this command by selecting a few paragraphs, and then control-click on the style in the paragraph Panel. A shortcut would be much faster.

    I've attached a screenshot of the menu with the command that I'm looking to make a shortcut.

    Thank you!

    Screen Shot 2016-08-30 at 11.51.18 AM.png

    Here is a link to the free "Apply Next style" quick script that makes it very easy to apply the following style to the selected paragraphs:

    http://www.ID-extras.com/InDesign-quick-apply-with-next-style

    Enjoy!

    Ariel

  • 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!");

    }

  • Assignment of a paragraph style to the text that you add to and block of existing text without changing the existing text? Using AppleScript.

    I have and added existing framework of text I want to add more text and at the same time assign a style to text.

    Then add more text to the same text frame later.

    I can do using 'set applied font statements' but what I want to do is to use styles for each entry.  Several times the styles are different for each addition.

    say application "Adobe InDesign CC.

    say history of parent of text block x of the page 1 of document 1

    the value apply fonts of insertion point - 1 for "Chalkduster".

    the value point size of insertion point - 1 to 12

    -character style from the insertion point to - 1 to the 'New' value - does NOT work

    the value content of insertion point - 1 to return & "Either Me!" & back -inserts after

    end say


    IndesignCC

    iMac OSX 10.9

    AppleScript

    Script debugger 5

    Xcode 5.1


    Thank you

    Mike

    -assumes the current paragraph ends with a return

    game of newText for "either Me!" & return

    say application "Adobe InDesign CC.

    say document 1

    the value storyRef to parent history of text frame 1 of page 1

    the value paraStyle to the style of paragraph 'new '.

    the value insertRef to the insertion point -1 of storyRef

    the value of beginIndex to index of insertRef

    say insertRef

    the value content to newText

    end say

    endIndex put to beginIndex + ( of newText length) - 1

    value textRef in (a reference for the characters thru of storyRef endIndex-beginIndex)

    the value applied paragraph style of textRef in paraStyle

    end say

    end say

  • Assign shortcuts to paragraph styles

    Hi all

    I use InDesign CC trial version now, and I would buy it after using it for a few weeks. I couldn't assign shortcuts to paragraph styles. Is it my problem or a restriction in the system? Could someone help me with this.

    When I click on the space provided for the addition of shortcut we are not throwing any message of error or I would say that I could click this text box and the cursor flashes but I couldn't I attribute a shortcut.

    Thank you.

    Sisi

    Shortcuts for paragraph styles consist of a number on a keypad and a modifier key (for example, hit Cmd/Ctrl or Alt/Option). If your computer does not have a numeric keypad, you may need to use another method as fast application to apply paragraph styles.

  • Apply the style of Pará to the xml element based on the type of master page?

    IM using a flow xml, im importing the xml to be used across different master page templates and I want to apply paragraph styles different items depending on what master page xml, they are on...

    So I have 3 put templates in place

    Type of page 1

    Type of page 2

    Type of page 3

    and 3 paragraph styles

    style 1

    style 2

    style 3

    I have the same xml structure deposited on each page...

    < Entry >

    < name > Page < / name >

    < / name >

    So, can I use javascript to apply the paragraph (style 1) style to the xml element (name) on any page that uses the master page (type of Page 1)

    Is this possible? whether and how this could be done?

    Thanks in advance

    Hello

    Try:

    #include '... / XML rules/glue code.jsx ";

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

    var myRuleSet = new Array (new applyParaStyle());

    {with (MyDoc)}

    var elements = xmlElements;

    __processRuleSet (Elements.Item (0), myRuleSet);

    }

    function applyParaStyle() {}

    myIdName = "Xp".

    This.XPath = "//restaurant_name";

    This.Apply = function (myElement, myRuleProcessor) {}

    {with (MyElement)}

    {Switch(insertionPoints[0].parentTextFrames[0].) ParentPage.appliedMaster.Name)}

    case "X-Master:

    App.Select (texts);

    App.Selection [0]. FillColor = myDoc.colors.item ("xxxx");

    break;

    case 'guide-Scotland:

    App.Select (texts);

    App.Selection [0]. FillColor = myDoc.colors.item ("scotland");

    by default:

    break;

    }

    }

    Returns true;

    }

    }

  • [win] [js] [cs4] find/replace the paragraph styles without losing the replacements the

    Hi guys I need some help here.

    I created a javascript script that will find and replace paragraph styles for the DOCFILE with indesign paragraph styles. everything works fine but the problem is that, when she applies paragraph styles, he loses all replacements the. I tried:

    changetext (false);

    but his does not work, this is a kind of conditional parameter that I can put in the function changetext() so that it used clear local overrides?

    Thank you.

    Horse

    Use findGrep() (or findText()) instead of changeText(). This returns an array of items found. Then, you can loop through the array and apply a paragraph style without erasing the replacements (the 2nd parameter must be false).

    Example:

    Main();
    
    function Main() {
        var foundItem;
        var doc = app.activeDocument;
    
        app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;
    
        app.findGrepPreferences.findWhat = ".+";
        app.findGrepPreferences.appliedParagraphStyle = "Body text";
    
        var foundItems = doc.findGrep();
    
        for (var i = 0; i < foundItems.length; i++) {
            foundItem = foundItems[i];
            foundItem.applyParagraphStyle(doc.paragraphStyles.item("Body"), false);
        }
    
        app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;
    }
    
  • Application of paragraph to a single paragraph style affects all paragraphs

    Hey,.

    I am trying to create a script that would take a picture of text objects that describe the text and style of a particular line of text. And in a few lines to apply character Styles as well.

    The problem is that, although the script works when the loop is in the character styles 'mode', it seems to apply paragraph styles for all the last lines of the text when the aforementioned object asks him to only apply the paragraph style (no character styles).

    The offending line is the following:

    if ( typeof line.text == 'string' ) {
        frame.contents += "\r" + line.text;
        frame.parentStory.paragraphs[-1].appliedCharacterStyle = doc.characterStyles[0];
        frame.parentStory.paragraphs[-1].applyParagraphStyle(style);
        continue;
    }
    

    I even copied the lines of style-lap of the application section of the script ( the other part) character Styles, but it still applies the style to all the last lines of the text. The script below is the full code I have I want with one of the objects of text data. If I comment the lines of 'offending' mentioned above, the script applyes all models correctly. Otherwise, only the last line (Product - Description style) is applied, while all the previous lines reach the style "Spacer".

    Can you see what I'm doing wrong? (Sorry for the giant piece of code, but I can't pin-point this is not relevant here).

    [{
        'text': [
            {
                'style': 'Product - Title No Indent',
                'text': [
                    'Test Product',
                    {
                        'style': 'Superscript',
                        'text': '®'
                    },
                    ' Title'
                ]
            },
    
            { 'style': 'Spacer', 'text': ' x' },
            { 'style': 'Spacer', 'text': ' x' },
            { 'style': 'Spacer', 'text': ' x' },
            {
                'style': 'Product - Description',
                'text': ['Designed for monitoring steam sterilization processes.']
            },
        ]
    }];
    
    function add_text_to_frame (frame, product) {
        var i, l, j, k, line, style, line_styles, char_style, line_text, bit;
    
        for ( i = 0, l = product.text.length; i < l; i++ ) {
            line = product.text[i];
            style = doc.paragraphStyles.item( line.style );
            if ( typeof line.text == 'string' ) {
                frame.contents += "\r" + line.text;
                frame.parentStory.paragraphs[-1].appliedCharacterStyle = doc.characterStyles[0];
                frame.parentStory.paragraphs[-1].applyParagraphStyle(style);
                continue;
            }
            else {
                line_styles = new Array();
                line_text = '';
                for ( j = 0, k = line.text.length; j < k; j++ ) {
                    bit = line.text[j];
                    if ( typeof bit == 'string' ) {
                        line_text += bit;
                    }
                    else {
                        line_styles.push({
                            'start': line_text.length,
                            'end': line_text.length + bit.text.length,
                            'style': bit.style
                        });
                        line_text += bit.text;
                    }
                }
    
                frame.contents += "\r" + line_text;
                frame.parentStory.paragraphs[-1].appliedCharacterStyle = doc.characterStyles[0];
                frame.parentStory.paragraphs[-1].applyParagraphStyle(style);
    
                for ( j = 0, k = line_styles.length; j < k; j++ ) {
                    char_style = doc.characterStyles.item(line_styles[j].style);
                    frame.parentStory.paragraphs[-1].characters.itemByRange(
                        line_styles[j].start,
                        line_styles[j].end
                    ).applyCharacterStyle(char_style, true);
                }
            }
        }
    }
    

    It was strange. Can't really see what's going wrong here. But it seems to be resolved by changing this line:

    text_frame.contents += "\r" + product.text[i].text;
    

    to do this:

    text_frame.parentStory.insertionPoints[-1].contents = "\r" + product.text[i].text;
    

    This has the additional advantage of targeting of history and therefore do not break if the textframe overflows.

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

Maybe you are looking for