Extraction of texts of paragraph with RangeStyle

Hello!

I need help, extraction of text of paragraph peacekeeping style applied directly on the characters without going over all the characters.
Prerequisite - bypassing the need is paragraps.
For example: "a string representation of a value of FontFamily, possibly including values of relief or index in a font file, or a URI where the font family is thrilled. .
" For more information on the syntax, see Fontfamily."

In the myParagraph.TextStyleRanges (1). Texts (1) stored text with style "color = blue", and the content is really only part of the FIRST paragraph.

In the myParagraph.TextStyleRanges (2). Texts (1) stored text with style same "" BOLD"= true", but in mixed text, first and second paragraph simultaneously stored content.

RangeIndex = 1 to _story. TextStyleRanges.Count

Var InDesign.TextStyleRange As mRange = _story. TextStyleRanges (rangeIndex)

rStart = mRange.Characters (1). InsertionPoints (1) .index

RIP = mRange.Characters(-1). InsertionPoints (1) .index

ParagraphIndex = 1 to mRange.Paragraphs.Count

Dim mParagraph As InDesign.Paragraph = mRange.Paragraphs (paragraphIndex)

If mParagraph.ParentTextFrames.count > 0 Then

pStart = mParagraph.Characters (1). InsertionPoints (1) .index

pEnd = mParagraph.Characters(-1). InsertionPoints (1) .index

If pStart > = rStart can

If IsNothing (mTag) = false then

"new paragraph".

End If

Var _max = Math.Max (rStart, pStart)

Var _min = Math.Min (RIP, hangs)

pText = (_XMLCorrect (Mid (mRange.Texts (1) .silence, _max - rStart + 1, _min - _max + 1)))

"StyledText, bold or underline or italic of mRange.

End If

Next

Next

Tags: InDesign

Similar Questions

  • How to get a vertical Automatic centering of the text of paragraph in its bounding box in a composition of model.

    I use a composition of model to replace the different lengths of text in a number of instances of a graph custom in first Pro CC2015. The custom graph contains a circle shape with the text of the model implemented in the form of text of paragraph with its bounding box centered above the circle. Although I can justify to center text horizontally within the bounding box, I can't find a way to center the text vertically within the bounding box. The solution I'm looking for should work automatically with the text of different length strings used for different instances throughout the first sequence.

    No, there is no such thing. You could probably create an installation complicated with a host of text, possibly with an expression, but if not, you will need to manually adjust.

    Mylenium

  • Export to text file paragraph Style

    I have an InDesign document (several really), where I would like to extract all the text formatted with a paragraph style to create a glossary.

    I looked at ChangeCaseofSelectedStyle ExportAllStories and Dave Saunder trying to cobble something together (my scripting skills are next to zero). I had that day, now I'm stuck and errors.

    Any help?

    If ((app.documents.length! = 0) & & (app.selection.length! = 0)) {}
    myDoc = app.activeDocument;
    myStyles = myDoc.paragraphStyles;
    myStringList = myStyles.everyItem () .name;
    myExportFormatList = ['Text only', 'RTF', 'Text referenced InDesign'];

    myDialog = app.dialogs.add var ({name: "ExtractParagraphByStyle"})
    {with (MyDialog)}
    {with (dialogColumns.Add ())}
    with (dialogRows.add ()) {}
    with (dialogColumns.add ()) {}
    staticTexts.add ({staticLabel: "Style of paragraph :"});})
    }
    with (dialogColumns.add ()) {}
    myStyle = dropdowns.add({stringList:myStringList,selectedIndex:0,minWidth:133});)
    }
    }
    with (dialogRows.add ()) {}
    with (dialogColumns.add ()) {}
    staticTexts.add ({staticLabel: "export as :"}); "})
    }
    with (myExportFormatButtons = {radiobuttonGroups.add ())}
    radiobuttonControls.add ({staticLabel: "Text only", checkedState:true});})
    radiobuttonControls.add({staticLabel:"RTF"});)
    radiobuttonControls.add ({staticLabel: "InDesign tagged text"});
    }
    }
    }
    }


    myReturn = myDialog.show ();
    If (myReturn == true) {}
    Get the values of the dialog box.
    myExportFormat = myExportFormatButtons.selectedButton;
    myDialog.destroy;
    myFolder is Folder.selectDialog ("select a file");.
    If ((mondossier! = null) & & (app.activeDocument.stories.length! = 0)) {}
    myExtractParagraphByStyle (myExportFormat, myFolder);
    }
    }
    else {}
    () myDialog.destroy; s
    }
    }

    myExportStories function handles the export of the stories.
    myExportFormat is a number between 0-2, where 0 = text only, 1 = 3 = tagged text and rtf.
    myFolder is a reference to the folder in which you want to save your files.
    function myExtractParagraphByStyle (myExportFormat, myFolder) {}
    for (myCounter = 0; myCounter < app.activeDocument.stories.length; myCounter ++) {}
    monarticle = app.activeDocument.stories.item (myCounter);
    myID = myStory.id;
    {Switch (myExportFormat)}
    case 0:
    myFormat = ExportFormat.textType;
    myExtension = 'txt '.
    break;
    case 1:
    myFormat = ExportFormat.RTF;
    myExtension = ".rtf".
    break;
    case 2:
    myFormat = ExportFormat.taggedText;
    myExtension = 'txt '.
    break;
    }
    myFileName = "StoryID" + myID + myExtension;
    CheminMonFichier = myFolder + "/" + myFileName.
    myFile = new File (myFilePath);
    myStory.exportFile (myFormat, myFile);
    }
    }
    +++ Functions start here +++

    function errorExit (message) {}
    If (arguments.length > 0) {}
    If (app.version! = 3) {beep()} / / CS2 includes beep() function.
    Alert (message);
    }
    Exit(); CS ends with a beep; CS2 left silently.
    }

    The example script, export all the text to the file might give you some clues:

    ExportAllText.jsx
    An InDesign CS4 JavaScript
    //
    Export all the text in the active document with a single
    text file. To do this, the script will create a new document,
    combine the stories in the new document using export/import
    and then export the text into the new document.
    main();
    main() {} function
    mySetup();
    mySnippet();
    myTeardown();
    }
    function mySetup() {}
    myDocument var = app.documents.add ();
    myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
    myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
    myDocument.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
    myPage var = myDocument.pages.item (0);
    var myTextFrameA = myPage.textFrames.add ();
    myTextFrameA.geometricBounds = [72, 144, 72, 288];
    myTextFrameA.contents = 'This is story 1.';
    var myTextFrameB = myPage.textFrames.add ();
    myTextFrameB.geometricBounds = [72, 300, 228, 288];
    myTextFrameB.contents = 'This is the story 2.';
    var myTextFrameC = myPage.textFrames.add ();
    myTextFrameC.geometricBounds = [72, 444, 312, 288];
    myTextFrameC.contents = 'This is the story of 3.';
    }
    function mySnippet() {}
    //
    If (app.documents.length! = 0) {}
    If (. stories.length app.documents.item (0)! = 0) {}
    myExportAllText (app.documents.item (0) .name);
    }
    }
    //

    }
    function myTeardown() {}
    }
    //
    function myExportAllText (myDocumentName) {}
    var monarticle;

    File name for the exported text. Specify a valid file on your system path.
    var myFileName = "/ c/test.txt ';
    If you want to add a line of separation between the floors, myAddSeparator set to true.
    var myAddSeparator = true;
    var myNewDocument = app.documents.add ();
    var app.documents.item (myDocumentName) = myDocument;
    var myTextFrame = myNewDocument.pages.item (0).textFrames.add ({geometricBounds:myGetBounds (myNewDocument, myNewDocument.pages.item (0))});
    var myNewStory = myTextFrame.parentStory;
    for (myCounter = 0; myCounter)< mydocument.stories.length;="">
    monarticle = myDocument.stories.item (myCounter);
    Export the story as tagged text.
    myStory.exportFile (ExportFormat.taggedText, leader (myFileName));
    Import (place) the file at the end of the temporary history.
    myNewStory.insertionPoints.item(-1).place (File (myFileName));
    If the imported text does not end with a return, enter a return
    to keep the stories running together.
    If (myCounter! = myDocument.stories.length-1) {}
    If (myNewStory.characters.item(-1).contents! = '\r') {}
    myNewStory.insertionPoints.item(-1).contents = "\r";
    }
    if(myAddSeparator == true) {}
    myNewStory.insertionPoints.item(-1).contents = '-\r ";
    }
    }
    }
    myNewStory.exportFile (ExportFormat.taggedText, File("/c/test.txt));
    myNewDocument.close (SaveOptions.no);
    }
    //
    function myGetBounds (myDocument, myPage)}
    var myPageWidth = myDocument.documentPreferences.pageWidth;
    var myPageHeight = myDocument.documentPreferences.pageHeight
    if(MyPage.Side == PageSideOptions.LeftHand) {}
    var myPage.marginPreferences.left = myX2;
    myX1 = myPage.marginPreferences.right var;
    }
    else {}
    var myPage.marginPreferences.left = myX1;
    myX2 = myPage.marginPreferences.right var;
    }
    var myY1 = myPage.marginPreferences.top;
    myX2 var = myPageWidth - myX2;
    var myY2 = myPageHeight - myPage.marginPreferences.bottom;
    return [myX1, myY2, myY1, myX2];
    }

  • GREP: How to replace a paragraph with a manual line break break?

    Hello.

    I want to replace a few paragraph breaks (Enter) with manual line breaks (SHIFT + ENTER).

    How do I do that?

    Any help would be appreciated.

    GREP codes for all functions and special characters can be found in the help: help InDesign | Find/replace

    In this case, you do not want to change

    \r

    TO

    \n

    Be aware that this will stick together, paragraphs with all the consequences for its paragraph styles. I rarely do this (and then only unformatted text!) that I don't know yet if it will apply the above the following paragraph paragraph style, or vice versa.

  • How to replace the paragraph with a space mark

    Hello

    I received the contents of a manual in raster format, but each line of text ends with a paragraph mark. How to replace the paragraph with a mark space otherwise than by hand?

    In Word, this is pretty easy, but I don't see not any provision for it in the search box on 7.2 Frame.

    Yours,

    Michael F

    ========

    \p = end of paragraph

    \P = beginning of paragraph

    See: Help > keyboard shortcuts > keys for the search and replace

  • Script to add markers to the text in paragraph format

    With previous versions of Framemaker, I had a FrameScript that loop in my document and add a text marker based on the applied paragraph format. The marker text would be the selected paragraph.

    I try now to recreate it in Extendscript for use in Framemaker 10 and am completely perplexed.

    I have no doubt that my script (copied below) is completely off track, but I was wondering if someone would be able to help point me in the direction of my many mistakes.

    Basically I want the script to find all paragraphs with the "* Ref." format applied, make this text range of text and then apply a marker at this beach. A little research showed that I probably need to create a list of paragraph formats, but I think I have a lot more problems than that.

    var pgfFmt1 = flow. GetNamedPgfFmt (* part No.);

    While (pgfFmt1.ObjectValid ())

    {

    function createMarker (doc, FMP, offset, type, text) {}

    var strange, marker;

    Strange = pgfFmt1.TextRange;

    marker = doc. NewAnchoredObject (Constants.FO_Marker, strange);

    marker. MarkerType = type;

    marker. MarkerText = text;

    Return 1;

    }

    createMarker (doc, bmp, 0, 'Index', 0);

    Thank you in advance to anyone who is able to offer me some advice!

    You can use the following function to get the text of a paragraph of FrameMaker.

    function getText (textObj) {}

    var objText = "";

    Get a list of strings of the object.

    var textItems = textObj.GetText (Constants.FTI_String);

    Concatenate the strings.

    for (var i = 0; i)< textitems.len;="" i="" +="1)">

    objText += (textItems [i] .sdata);

    }

    Return objText;

    }

    Once you add it to your script, you can modify each call to createMarker to something like this:

    createMarker (doc, bmp, 0, 'subject', getText (FMP));

    -Rick Quatro

  • Up to version 6.22 of entry and other components HTML texts have been with a width. Now, after installing version 7. The entries have increased in size not more about before defined sizes... You can fix this?

    Up to version 6.22 of entry and other components HTML texts have been with a width. Now, after installing version 7. The entries have increased in size not more about before defined sizes... You can fix this?

    I think it's about the size, just differently than before. See the discussion in:
    https://Bugzilla.Mozilla.org/show_bug.cgi?id=691157

  • text messages sent with an email address from a touch ipod duplicated on a second ipod touch using a different email address, but the two ipods are controlled by a parent with the same apple ID and password.

    Text messages sent with an email address from a touch ipod duplicated on a second ipod touch using a different email address, but the two ipods are controlled by a parent with the same apple ID and password.  This has happened recently.  My two girls have used their respective ipods and texting, without their messages of duplication for each of the other ipods for more than a year.  Somehow recently, both addresses seem to be synced with them or something, so that both see each and other messages.  I've recently updated two ipods, iTunes on my computer--not the cloud and added music for two ipods, but has not changed anything by email email settings or message I know.  Help, please!

    Welcome to the Apple community.

    I can't fully follow how you have everything set up, but a glance at the settings > messages > send & receive

  • Photoshop 2015.5 CC: Text - text of paragraph tool

    Hello

    I can't change the width on a text paragraph by dragging the right side upper, medium and lower small square that appear when a text layer is active.

    When clicking the square just, it is committed, and deselect the layer. Workaround (kind of): layer converted to text and vice versa for the text of the paragraph then its possible to drag the boxes but only for a short time.

    Is this something others meet and is there a solution?
    MikaelUntitled-1.jpg

    Hello

    Sorry, you experience this problem. Try this workaround to see if that solves the problem of not being able to adjust the size of the text of paragraph https://helpx.adobe.com/photoshop/kb/enable-optional-extensions-photoshop-cc.html#Disable _ Reduce_User_Experience_Friction. However, where it says '3. Save the file as "PSUserConfig.txt" to your version of Photoshop settings folder:... "references to 2015 in the name of the file should be 2015.5 instead.

    I hope this helps.

  • During the typing of text after paragraph 4, the text jumps the same block of text there. Not sure if it's because of a page break. Help, please

    During the typing of text after paragraph 4, the text jumps the same block of text there. Not sure if it's because of a page break. Help, please

    And make sure that you do not use the Enter key on the numeric keypad.

  • Extraction of text from an existing site...

    I need to recreate a customer site but can really do without cut and paste... any suggestions?

    Even 3rd-party solutions welcome


    Thank you


    Garth

    Hello

    Try the Web site, TextEVO - Extraction of text / Image Manipulation and navigation

    On the file menu, click "Retrieve the text of the Web site", and then enter the URL of the Web page and it will bring you the text

    Let me know if you are looking for something else, or if I missed something.

  • Search the text of paragraph style and place them in the new text block with width 50mm

    Hello

    I'm looking for voor a paragraph to find script dat styles and place them in a new text block with width 50 mm.

    Is there a solution?

    Kind regards

    Patrick

    Width: options General of the frame of the text, GBA: fixed width, then 50mm width

    Height: automatic block text size options

    (These two in the dialog box object styles)

  • Extract text and coordinates with java on Linux

    Hello

    In java project, I need to extract the words with their PDF document details to be stored in the database. Can I do with Acrobat 7.0 SDK for Linux?

    There is no SDK for the development of Linux around Acrobat Reader for Linux.

  • Paragraphs with dynamic text

    Hello!

    I have a (mysql) database and a field titled article where I download my articles where I dynamically load in my Web page. However, the paragraphs in my area do not appear in my Web page - my items simply appear as one big block of text. Here, take a peek at http://financestudent.cutpage.com/news.php

    Is there a way to get my points? Or, better yet, a better way to achieve the creation of a news section?

    See you soon
    Jamie

    its ok, just figured it out, you put

    in the field of the database.

  • Add paragraphs with text

    Dear patients, caregivers,

    I want to "empty" the content of a table in a series of paragraphs. Two problems in my script:

    -Insert a \t TAB inserts a line break

    -items are not placed in successive paragraphs, but at the beginning of the flow - so sense reverse order and not own paragraphs

    t-write-array.png

    // write array to multiple paragraphs
      var items      = new Array ();
      var nItems, pgf, textLoc, oDoc; 
      items = ["Århus", "Çedille", "Dandy"];
      nItems = items.length;
      oDoc = app.ActiveDoc;
      
      pgf = oDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;  // get first pgf in flow
      textLoc = new TextLoc (pgf, 0);  
      for (var i = 0; i < nItems; i += 1) {
        insText = items[i];
        oDoc.AddText (textLoc, insText + "\t" + insText); // \t insert a NL...
        oDoc.NewSeriesObject(Constants.FO_Pgf, pgf);  // add a paragraph
        pgf = oDoc.NextPgfInFlow;
      }
    
    
    

    Hi Klaus,

    Just change your last line of

    oDoc.NewSeriesPgf (TFP);

    TO:

    PGF = oDoc.NewSeriesPgf (TFP);

    that should do it.

    If you point directly to the new portfolio.

    completely:

    write table in several paragraphs

    var elements = new Array ();

    var nItems, textLoc, FMP, oDoc;

    items = ['Århus', "Cedilla", "Dandy"];

    nItems = items.length;

    oDoc = app. ActiveDoc;

    PGF = oDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;  get TFP first rate

    for (var i = 0; i)< nitems;="" i="" +="1)">

    textLoc = new TextLoc (BMP, 0);

    insText = items [i];

    oDoc.AddText (textLoc, insText + "\x08" + insText); \t Inserts a NL...

    If (i< nitems="">

    PGF = oDoc.NewSeriesPgf (TFP);                       Add a paragraph

    }

    }

Maybe you are looking for