Split or character style indesign standard carriage return

Hello. I use the Split text by paragraph style, but...

I need a lot split text with styles applied too much character. For example.

Screen Shot 2016-03-18 at 3.11.18 PM.png

Is this possible with a script, grep...?

Please help me.

Try

function addLinefeeds() {
    var doc, cs, l, finds;
    doc = app.properties.activeDocument
    cs = doc && doc.characterStyles.itemByName("answer"); // change
    if (!cs || !cs.isValid) {
        alert("No Finds, try changing the characters style name");
        exit();
    }
    app.findTextPreferences = app.changeTextPreferences = null;
    app.findTextPreferences.appliedCharacterStyle = cs; // change to styleName
    finds = doc.findText();
    l = finds && finds.length || 0;
    while (l--) {
        // if not allready on a new line put add a new line
        if (/[^\n\r]/.test(finds[l].contents[0]))  finds[l].insertionPoints[0].contents = "\n";
    }
}
app.doScript(addLinefeeds, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "add line feeds to characterStyles");

Tags: InDesign

Similar Questions

  • Importing of XML in Indesign text friendly "carriage returns.

    Hello
    I have a question regarding the import of XML in Indesign.  I have my text stored in Excel (Fig A) and intend to export to an XML file, where each line will represent each page.  However, my first attempt failed process "cart returns" I had considered:
    "Carriage returns" used within a cell in Excel (ALT + ENTER) are preserved during the transformation to a CSV (fig. B).  However, when converting a file XML, the conversion takes place on a line-by-line, and therefore, the XML file becomes incomplete (Fig C).

    So it seems, I need to make sure that the CSV file contains one line per entry, while maintaining the real transport returns in my spreadsheet source and for Indesign to recognize.  To do this, I'll need to substitute "carriage returns" in my excel column to be represented by a new set of characters.  My question is how can I let Indesign can recognize this set of characters to be converted to a carriage return, importing text.
    For example, if the character set has been ' %% ', then my new csv file would look like Figure D and XML would be produced correctly, as the Figure E.  Then import this XML file into InDesign, return transport would be automatically restored, if all goes well.

    I hope someone can help me because I am only starting in Indesign and feel Im running until I can walk by embarking on the XML/Indesign arena too early.
    Best regards
    Luke
    XML_ReturnIssue.JPG

    No, I don't think.

    The fact is that ^ is a special character to find/replace.

    so you should either avoid its use in search strings to avoid confusion.

    or if you agree the confusion, you must use ^ ^ n to search for

    (instead of ^ n).

  • To add a carriage return in paragraph styles

    Hello. I'm a mess. I have a large amount of data from an xml source. I need to quickly add carriage returns properly across it so that paragraph styles can be differentiated. I use tags manually mapped to styles to do this.

    In the transport order returns am I right to think that I can add a GREP style for each style of Pará, and that it will be the direction of the end of Pará through the position of end of each tag marker? If that's the case, what GREP expressionlook would like that I can automate locate the end of a tag/para style so that I can add ~ b for her?

    With gratitude!

    [French]

  • Ability to add the carriage return character

    Hi all

    I have to add the characters return at the end of each paragraph.  I found insertTextAsContent (using: {String |}) SpecialCharacters} ( position: XMLElementPosition), but do not know how to use this function. I think that in this method only accepts the position as an XML element.

    How to use this feature to accomplish my task?

    Use: InDesign CS4/Javascript/Windows.

    Kind regards

    Karpanai

    you could do: string = "\r";

    \r is a carriage return, and \n is a newline

  • Add a line as part of a character style in InDesign CS4

    Hi all

    I am new to InDesign and am in the process to design a 4-page newsletter inside IT Department of my company.

    Each page (A4) has 2 columns and contains one or more articles.

    I would like to create a character style to format the title of each article so that it stand out and include a line under the text.

    I took a look at in the underline options and almost found what need me except that I would like until the line is the same length as the column width and not the length of the text that she says. If I managed to get what I wanted by drawing a line; but is it possible to include this line in my style "section header" so I shouldn't draw every time?

    Or maybe there is an option to make the longer than the text underline, but I can't find it.

    Thanks in advance

    A paragraph NET is what you are looking for.

    Bob

  • Convert the local Word to indesign character style formatting

    Hello

    I have a Word doc with local formatting (no paragraph or character style)

    Is there a way I can convert all text which is Times New Roman Italic in a style of character so that I can format everything at the global level?

    Any help in this would be be surprising (250 pages)

    Find > Find format > basic character formats > Font Style > Italic

  • Delete tagged text carriage return

    Hello

    I'm trying to score a few points, but I have some difficulty. I would like to mark all paragraphs of a textframe.

    I do it like this and works like its supposed to:

    var paragraphs:Array = indesignTools.getParagraphsForTextFrame(currentTextframe.id);
    
    for (var j:uint = 0 ; j < paragraphs.length ; j++) {
        var currentParargraph:Paragraph = paragraphs[j];
        if (currentParargraph.isValid) {
            InDesign.app.activeDocument.xmlElements.add("section", currentParagraph);
        }
    }
    

    Now, the problem I have is that, if the paragraph has a cart at the end, this carriage return should not get tag,

    so I should finish with a paragraph labeled, NOT to mention the last return transport.

    How do I change my code if I can mark all paragraphs without the last carriage return?

    Still waiting for a few comments of thanks or a useful on the post on the recovery of the properties of a "nil" style of characters but anyway...

    Why not just replace

    var currentParargraph:Paragraph = paragraphs[j];

    with something like

    var currentParargraph:Paragraph = paragraphs[j].characters.itemByRange(0,-2)

    It does not test, but should work.

    Don't forget to tell your little.

    Trevor

  • default or any text in a character style sheet

    Hello

    I'm trying to style text using paragraph and character style sheets, I built. When I create a new text box and import text from a Word file, all the text I have import default values to one of my character style sheets. Before importing the text, I have check the cursor inside the empty box and the paragraph style is standard paragraph and character style is 'none '. Yet, when I import text, it is always default to a specific character style I created.

    Any help with this would be greatly appreciated.

    Thank you

    Nick

    Check your paragraph styles to see that you do not use the nested styles or GREP styles except when you need it. You can have a nested style that does not turn off the coast.

    While your description indicates this isn't the problem, it is worth checking. There is a bug in InDesign, where it applies a default character imported text style. You set the default character style by selecting a character style while no text block is selected and that you not change any text. If there is a default character style, click None for the value None as the default character style.

  • Auto character style applies in new tables and imported text

    Hi, I saw a post related to this problem, but it does not solve mine (check the default object style).

    So my problem is that when I import a Word document or I create a new table in InDesign, it is always a character that automatic style applies to my text and I don't really know why, I don't know what kind of option/preference to watch, I was looking in the paragraph/object/table styles, nothing seems to show me the character style that applies by default everywhere.

    Someone has an idea? I'm sure it's an easy problem to solve.

    Thanks in advance!

    Make sure that the standard paragraph is selected before importing the text. Or at least the Style of the paragraph that you want to the text.

  • (AS) Select the text of the paragraph without bringing out the carriage return

    (AS) Select the text of the paragraph without bringing out the carriage return character.

    I need help to select a paragraph in a story.
    The selection does not contain a 'return' (ASCII number 13 ")

    My current sample is as follows:
    -example assumes that the insertion point is already placed in a specific paragraph.

    Tell application "Adobe InDesign CS3"
    activate
    theDoc Set to the active document
    say theDoc
    Select the paragraph 1 of the selection
    end tell--theDoc
    end tell--app

    Sounds simple... The example above to select my paragraph selected.

    but he also chose the carriage return also. How would I go to do this?

    Any advice would be helpful!

    Thank you!

    Try:

    Select text in character-2 of paragraph 1 of the selection of character 1

  • Generate list of a document text paragraph/character styles?

    Hello. Does anyone know how to generate a list from a text paragraph/character styles?

    Nothing at all? Use a script! This JavaScript does the trick:

    myFile = File.saveDialog("Store this data, where?", "Plain text:*.txt");
    if (myFile == null)
     exit(0);
    myFile = File(myFile.fsName);
    myFile.open("w");
    myFile.writeln ("Character styles");
    myFile.writeln ("================");
    for (a=1; a
    

    Copy, paste it into a text editor (the editor ESTK which accompanies your InDesign is good). Save it as "storeStyles.jsx" in your Script file. When recording in the right place, it appear automatically in the actions panel. Double-click it to run it.

    Both character and paragraph style tables start the counter to 0, but the first character style is always "[None]", and the first paragraph of the styles are always "[None]" and "[standard paragraph].

  • After the creation of these character styles, apply clear replacements...

    Hello world

    After you import the Word document into InDesign CS3 in some paragraphs, there are some substitutions of style. InDesign formatting styles are not correctly designed with paragraphs. Even if that word styles are mapped with InDesign styles exactly. If I select all paragrahs and click on the 'Clear the replacements' option in the palette paragraph styles, all InDesign formatting styles are applied correctly, but the character style formatting are removed. So I planned to create the script for each font style character style and each formatting characters. After doing this I can clear overrides paragraph hassle styles. I have created the script to create styles for characters and formatting his job very well, but when I tried to run this script for the 2nd time in the same document that it showing an error inside. Please find below my script and it is too large,

    ------------------------------------------------------------------------------------------ -------------------

    To find the police and setting styles in form and its replacement by styles of characters
    Script for CS3

    inDesign #target
    myDoc var = app.activeDocument;
    If (myDoc.characterStyles.item ("Itl") == null) {}
    var Itl = myDoc.characterStyles.add ({name: "Itl", fontStyle: "Italic"}) ;}
    If (myDoc.characterStyles.item ("bl") == null) {}
    BL var = myDoc.characterStyles.add ({name: "bl", fontStyle: "Bold"}) ;}
    If (myDoc.characterStyles.item ("bItl") == null) {}
    bItl var = myDoc.characterStyles.add ({name: "bItl", fontStyle: "BoldItalic"}) ;}
    If (myDoc.characterStyles.item ("bItal") == null) {}
    Bollet var = myDoc.characterStyles.add ({name: "bItal" fontStyle: "Bold Italic"}) ;}
    If (myDoc.characterStyles.item ("sb") == null) {}
    SB var = myDoc.characterStyles.add ({name: "sb", fontStyle: "Semibold"}) ;}
    If (myDoc.characterStyles.item ("sbItal") == null) {}
    var sbItal = myDoc.characterStyles.add ({name: "sbItal", fontStyle: "Semibold Italic"}) ;}
    If (myDoc.characterStyles.item ("blk") == null) {}
    BLK var = myDoc.characterStyles.add ({name: "blk", fontStyle: "Black"}) ;}
    If (myDoc.characterStyles.item ("obl") == null) {}
    OBL var = myDoc.characterStyles.add ({name: 'obl', fontStyle: "Oblique"}) ;}
    If (myDoc.characterStyles.item ("li") == null) {}
    Li var = myDoc.characterStyles.add ({name: "li", fontStyle: "Light"}) ;}
    If (myDoc.characterStyles.item ("liItal") == null) {}
    var liItal = myDoc.characterStyles.add ({name: "liItal", fontStyle: "Light Italic"}) ;}
    If (myDoc.characterStyles.item ("sup") == null) {}
    var sub = myDoc.characterStyles.add ({name: "sup", position: Position.superscript}) ;}
    If (myDoc.characterStyles.item ("sub") == null) {}
    void var = myDoc.characterStyles.add ({name: "sub", position: Position.subscript}) ;}

    app.findTextPreferences = NothingEnum.nothing;
    app.changeTextPreferences = NothingEnum.nothing;

    app.findTextPreferences = null;
    app.changeTextPreferences = null;

    app.findTextPreferences.fontStyle = "italic";
    app.changeTextPreferences.appliedCharacterStyle = Itl;
    App.Documents.Item (0) .changeText ();
    app.findTextPreferences.fontStyle = "Bold";
    app.changeTextPreferences.appliedCharacterStyle = bl;
    App.Documents.Item (0) .changeText ();
    app.findTextPreferences.fontStyle = "BoldItalic";
    app.changeTextPreferences.appliedCharacterStyle = bItl;
    App.Documents.Item (0) .changeText ();
    app.findTextPreferences.fontStyle = "Bold Italic";
    bItal = app.changeTextPreferences.appliedCharacterStyle;
    App.Documents.Item (0) .changeText ();
    app.findTextPreferences.fontStyle = "Semibold";
    app.changeTextPreferences.appliedCharacterStyle = sb;
    App.Documents.Item (0) .changeText ();
    app.findTextPreferences.fontStyle = "Semibold Italic";
    app.changeTextPreferences.appliedCharacterStyle = sbItal;
    App.Documents.Item (0) .changeText ();
    app.findTextPreferences.fontStyle = 'Black ';
    app.changeTextPreferences.appliedCharacterStyle = blk;
    App.Documents.Item (0) .changeText ();
    app.findTextPreferences.fontStyle = "Oblique";
    app.changeTextPreferences.appliedCharacterStyle = obl;
    App.Documents.Item (0) .changeText ();
    App.Documents.Item (0) .changeText ();
    app.findTextPreferences.fontStyle = "light";
    app.changeTextPreferences.appliedCharacterStyle = li;
    App.Documents.Item (0) .changeText ();
    app.findTextPreferences.fontStyle = "Light Italic";
    app.changeTextPreferences.appliedCharacterStyle = liItal;

    app.findTextPreferences = NothingEnum.nothing;
    app.changeTextPreferences = NothingEnum.nothing;

    app.findTextPreferences.position = Position.superscript;
    app.changeTextPreferences.appliedCharacterStyle = sup;
    App.Documents.Item (0) .changeText ();
    app.findTextPreferences.position = Position.subscript;
    app.changeTextPreferences.appliedCharacterStyle = sub;
    App.Documents.Item (0) .changeText ();

    function setupFindText (find, change, PT, hidLayers, lockedLayers, lockedStories, masters caseSensitive) {}
    app.findTextPreferences = null;
    app.changeTextPreferences = null;
    try {app.findTextPreferences.findWhat = find} catch (e) {};
    try {app.changeTextPreferences.changeTo = change} catch (e) {};
    app.findChangeTextOptions.properties = {}
    includeFootnotes: (PT == null? false: PT).
    includeHiddenLayers: (hidLayers == null? false: hidLayers).
    includeLockedLayersForFind: (lockedLayers == null? false: lockedLayers).
    includeLockedStoriesForFind: (lockedStories == null? false: lockedStories).
    includeMasterPages: (masters == null? false: Masters).
    includeCaseSensitive: (caseSensitive == null? false: caseSensitive)
    }
    } / / end setupFindText
    Alert ("DONE");

    ------------------------------------------------------------------------------------------ -------------------

    Please suggest how simply this script and make it run faster that anyone can suggest me. Also suggest me how can add this "Clear Override" syntax with this script. I want to make this very effective script. Thanks in advance to all.

    Concerning

    Indana

    Enough basic syntax, really.

    First, as indicated in the documentation, the argument is optional; Second, its default behavior is "All". You get 'all', because you have not provided any argument, and you expected something else. Apparently, you want to clear the formatting only. Just use

    myStory[j].clearOverrides(OverrideType.PARAGRAPH_ONLY);
    

    Notice that the documentation indicates the return type of this function is zero; This means that you get no return value, and it is of no use to "store" the result in a variable myOvClr.

  • Character styles do not work in Pages

    I'm on a MacBook Pro (13-inch, mid-2014, retina), running 10.10.5 (14F1021) and run pages v. 5.6.1

    It's pretty simple: I'm searching the internet apple documentation and Web sites.

    To the title of the pane 'format' to the right of the workspace, there is an option below 'police' called 'Styles of character ".  There is no way, in this latest version, to create a new character style.  No selection there will allow you to press the symbol '+', and there is no menu in the menu bar you option to create a character style.

    Despite trying several ways of dozens to understand this point, there is no work around.  I think it's a bug.

    Please fix this Apple?  I love the pages, but boy, this can be frustrating.

    Thank you!

    I use Pages on El Capitan 10.11.1 v5.6.1. I can define a character style.

    Try the following:

    1. Type a word or two. Select them.
    2. Press command + T to launch the Panel font
    3. In the toolbar, click the selector bar and in this menu, choose color
      1. Choose red
      2. Unique, choose the menu bar (you now have a single, red strikethrough)
    4. Selected always your text
      1. Click Character Styles picker
      2. The + symbol is now blue
        1. Click on + to add
        2. Change the new name of red bar, then press return to set.
      3. Click on any character Style
      4. Click the character crossed Red style to test.

    If you want any style of character custom for later use, you will need to make a custom template for new documents, or simply a model of style that you can open separately and then using the Format menu, styles of copy/paste between your model as well as the current document.

  • Write spreadsheet adds carriage return

    I use the array build function to set up a number of channels and build an array of strings.  The construction is in a time loop.  A new row is added in the table to each loop.  I use scripture to spread worksheet function to save the worksheet to a file with the xls extension.  For some reason, a carriage return is inserted in the table.  The table has 9 columns and a carriage return is placed after the fourth column.  I haven't added that carriage return.  Does anyone know why write about the spreadsheet can automatically add a carriage return, and how to remove it?

    Thank you!

    I'm not playing an instrument.  If the instrument is the addition of bottom line as a character of endpoint, which is likely, source your extra carriage return.

  • Error reading the port series when the hexadecimal value is 0d (carriage return)

    Hello

    I'm reading a string of 80 bytes from the serial port, but if one of these bytes is 0d (hexa) the rest of the bytes are not read because the read node Visa sees the value 0D as ASCII for the return shipping. How can I read the entire string and see the 0d as a value and not as a symbol of the ASCII?

    Manual

    Of course, she sees it as a carriage return and ends. That's what you have programmed to do. The "character of endpoint allows" set to false with your VISA to set up the Serial Port. What Steve has already said. Claire?

Maybe you are looking for

  • App missing Documents

    I recently made a few changes, accidentally turned on iCloud and all my data went to the cloud. Frustrating because I would rather have it on my computer. Apart from that my entire application of Documents is missing. It shows in the cloud and I copi

  • How to speed up the tempo of the song, as in this way...

    How to speed up a 8-16 bar snare roll for example from 128 to 140-170 or something like kind of how they did in this second generation in this track - https://soundcloud.com/smashthehouse/coone-x-bassjackers-x-gldy-lx-sound-barrier

  • How to restore a Firefox refreshed all bookmarks to an external hard drive?

    I've just 'refreshed' Firefox and lost ALL my passwords, even if the instructions said that they would be saved. I tried to copy it in the folder of old data from Firefox and it does NOTHING. I have all the data I need on an external hard drive and t

  • HP PAVILION G6: HP PAVILION G6 bios administrator password reset

    I have a HP Pavilion g6 with a game password. As soon as you start looking for a password. I've seen other posts where you have provided a code to bypass the password. My system code is 90139349. Any help would be greatly appreciated. Thank you in ad

  • My computer works fine.

    My task manager does not No matter what Antivirus will not open and some anitvirus not installed when I open the setup and then install automaticlly close any software fix that windows does not.And registry also does not work. Help me!