A better way to get all the text style ranges in a table

I am trying to get all the text varies from the style of my document into one. I'm scripting in JavaScript, which I'm not very familiar with, so maybe that's the problem.

This is what, in my view, should work:

app.activeDocument.stories.everyItem().textStyleRanges

The above doesn't give me a text string, not an array of objects of text style than I expected. If I were using Applescript I would ask just for the beaches of text style object reference, but it is not a property that I found in the javascript object model.

So I resorted to what is slower, but gives me what I want:

var allStyleRanges = new Array();
for (var g = 0; g < myStories.length; g++) {
  var storyStyleRanges = (myStories[g].textStyleRanges);
  for (var s = 0; s < storyStyleRanges.length; s++) {
  allStyleRanges.push(storyStyleRanges[s]);
  };
};

Does anyone have a better way?

Lev,

May it as your requirment...

alert(app.activeDocument.stories.everyItem().textStyleRanges.everyItem().getElements())

Concerning

Siraj

Tags: InDesign

Similar Questions

  • Get all the text values in a XML node

    Suppose I have a XMLList that I'm working my way through and I want to quickly and easily get all the 'text' from the node. In other work strip the < xmtag > all possible markup and attributes and just leave the content.

    There is a simple/fast way to do it?

    < myNode >

    < title > title an event here < /title >

    < host > name and title of the presenter here < / presenter >

    < date startTime = "Somedate" / >

    < desc > <! [CDATA [text here. [[It < b > would < /b > have html or links or something like.]] > < / desc >

    < resources >

    list of < resources > has some resources, downloads, etc. < / res >

    < resources > another site or something like < / res >

    < / resource >

    < / myNode >

    If the xml is your XML instance, after loading is finished:

    trace (XML.descedants("*"). Text());

  • Is there a way to get all the names of collection under which an entity is attributed?

    Is there a way to get all the names of collection under which an entity is attributed?

    Hello

    For a list of the collections which make reference to a specific entity, please refer to the following API request (see documentation of swagger producer-Service-entity ):

    GET /publication/ {publicationID} / {entityType} / {entityName} / {referencingEntityType}

    This request has been added to the content producer DPS2015 API examples, you can now use the getReferencing()function. Please see /article/get_referencing_entity.php for the complete example.

    You can download the latest examples of producer API Content DPS2015 and swagger documentation from here, all the resources are in a file single zip.

    -Mike

  • Is there a way retroactively copy all the text highlighted?

    I pointed out the text in a pdf document without activating the function "copy the text selected highlight... ». Is there a way retroactively copy all the text highlighted?

    Yes, it is possible to do it with a script (in most cases). I'll send you a PM with more details.

  • Need to get all the text of the particular applied character style

    Can someone help me I need to get all the texts of the particular applied character style

    app.findTextPreferences.appliedCharacterStyle = 'style1 Character. "

    app.findTextPreferences.appliedCharacterStyle = 'style1 Character. "

    var mf = app.activeDocument.findText ();

    var myText = ";

    for (var i = 0; i)<>

    myText is myText + mf [i] .silence;.

    }

    Alert (MyText);

  • Is there a way to extract all the text from the captivate course?

    Hi all, someone can tell me if there is a way to extract all the text from a captivate file? We need to convert all the texts on the audio screen and insert audio into each slide... Thank you for all the input.

    Hello

    Try clicking on file > export > project captions and subtitles. Who should produce a Microsoft Word document.

    See you soon... Rick

    Useful and practical links

    Captivate wish form/Bug report form

    Certified Adobe Captivate training

    SorcerStone blog

    Captivate eBooks

  • IIOMetadataNode is there an easy way to get all the items?

    Y at - it an easy way to get all elements with no recursion to a depth of level in the XML getAsTree IIOMetadataNode ("formatname") document and make the images of type jpeg with EXIF metadata (when its present on the image) who return to the IIOMetadataNode?

    You can call getChildNodes() on the node returned by getAsTree(). The returned NodeList will contain children with a depth of level.

    The EXIF data will be be summarised into a byte array [] under a sequence of 'unknown' marker with a value of 225 marker.

    /**Returns the EXIF information from the given metadata if present.  The
     * metadata is assumed to be in 
    javax_imageio_jpeg_image_1.0
    * format. If the EXIF information were not present, then null is recuperer.* / public static ubyte [] getEXIF (IIOMetadata meta) {//javax_imageio_jpeg_image_1.0 //-->markerSequence //--->unknown (attribute: 'MarkerTag' val: 225 (for exif)) root IIOMetadataNode = (IIOMetadataNode) meta.getAsTree ('javax_imageio_jpeg_image_1.0');} IIOMetadataNode markerSeq = root.getElementsByTagName("markerSequence").item (0) (IIOMetadataNode); Notorious NodeList = markerSeq.getElementsByTagName ("unknown"); for (int i = 0; i)< unkowns.getlength();="" i++)="" {="" iiometadatanode="" marker="(IIOMetadataNode)" unkowns.item(i);="" if("225".equals(marker.getattribute("markertag")))="" {="" return="" (byte[])="" marker.getuserobject();="" }="" }="" return="" null;="">

    You must use a TIFFImageReader to analyze the table of byte [] being the TIFF metadata EXIF metadata.

  • Is there a better way to remove all the "sent" files other than by checking each of them?

    Before using Firefox, all my "sent" internet files appeared 50 to a page that is easy to remove. Some I wanted to keep, so deleting a page at a time was easier to do. Now to remove them, I have to check each node individually. Is there a simpler way?

    Hello condogal, you post to the support forum for firefox - firefox is a browser and does not handle your emails. in case you use thunderbird as an email client and have a problem with it, please ask your question in https://getsatisfaction.com/mozilla_messaging/ or in the case where you access your emails via webmail, please contact your e-mail provider to help you...

  • Get all the tables on a page

    I need to get all of the tables on a particular page. The document consists of a bunch of unrelated text blocks. I use this to retrieve the tables:

    var doc = app.activeDocument;
    page var doc.pages = [54];

    var tables = page.textFrames.everyItem ().tables.everyItem () .getElements ();
    Alert (tables. Length);

    This page (page 55) has 3 tables on it, but my code returns only 2 tables. A table can be placed directly on a page and not be in a block of text? If Yes, what is the best way to get all the tables in a page? Thank you very much.

    Rick Quatro

    Ah, I don't know who. "Tables" is a collection, not a simple table and a reckless experimentation of shows that you can't simply use .concat glue them together.

    I'm sure I've seen a couple of workarounds for a situation like this. Maybe it's time to read "[CS3] [JS] everyItem() and getElements()"-i.e. of Marc Autret posts on this subject, at the end of this thread.

    In other words, if you stick to use everyItem()! It is perhaps easier to build a table "the old-fashioned way". Copy the following code is based on my earlier assumption you officials texts bound in management of related texts, but you can rewrite it to accommodate groups, thus:

    t = app.layoutWindows[0].activePage.textFrames.everyItem().tables;
    tableList = [];
    for (i=0; i		   
  • How to select all the text with QNX TextInput

    With QNX TextInput, is there a way to select all the text? Spark TextInput a selectAll() method to select all text, but I do not see a similar method in QNX TextInput. No idea how you can choose all the texts with QNX TextInput. Thank you.

    Hey French,.

    Thanks for the clarification! I think I can help you. Here is a code example to show my explanation. In the code below when a user clicks the LabelButton object it will assign the focus to your TextInput object and then select all the text in this object. The only downside is that it will not bring the keyboard. so far, we are not successfully by invoking the keyboard without the user clicking on the TextInput. in any case in the code below, we use TextInput property the textField object as a reference to the TextField object internal. from there, we use the setSelection() method to select the text inside the object from the start to the end position pos. Here's the same code:

    package
    {
        import flash.display.Sprite;
        import flash.display.StageAlign;
        import flash.display.StageScaleMode;
        import flash.events.FocusEvent;
        import flash.events.MouseEvent;
    
        import qnx.ui.buttons.LabelButton;
        import qnx.ui.text.TextInput;
    
        [SWF(width="1024",height="600",backgroundColor="#CCCCCC",frameRate="30")]
        public class TextInputTest extends Sprite
        {
    
            private var myInput:TextInput;
    
            public function TextInputTest()
            {
                super();
    
                // support autoOrients
                stage.align = StageAlign.TOP_LEFT;
                stage.scaleMode = StageScaleMode.NO_SCALE;
    
                myInput = new TextInput();
                myInput.setSize(300,50);
    
                addChild(myInput);          
    
                var newBtn:LabelButton = new LabelButton();
                newBtn.label = "Click Me";
                newBtn.setPosition(325, 0);
    
                newBtn.addEventListener(MouseEvent.CLICK, selectMyText);
    
                addChild(newBtn);
    
            }
            private function selectMyText(e:MouseEvent):void
            {
                stage.focus = myInput;
                myInput.textField.setSelection(0, myInput.textField.length);
            }
        }
    }
    

    hope it's what you want. Good luck!

  • How to select all the text, all layers including locked or not visible, using VBScript?

    I'm looking for the more elegant syntax through a document and select all the text frames.

    You cannot select objects in... locked or hidden layers, so you will need to unlock/show layer and do what you need to do with the text, while the layer is visible/unlocked.

    to get all the loop text through the text in the object of the document, you will get all the text elements. If you loop through text in a layer object, you won't get the text located within groups.

  • Text entry box does not show all the text

    I'm creating a simple exercise where I want the user to copy text from the course, paste into word and report back what the number of words.  I thought that perhaps the text entry box would be the best way to go, since if you click the text (the default), you can copy it.  However after I place the paragraph of the text in the box and resize in the editor, until all of the text shows, it does not show all the text during playback is previewd or published.  It only shows the last words of the last row in the upper part of the box.

    Is there something that I am missing?  Or, is there a more easy/better way to do what I need?

    Thank you

    Hi all

    If it Captivate 4, there may be no need of a widget to do this. I'm guessing that you haven't tried allowing the scroll bar for the text of the entry (TEB) box?

    When I just plop a TEB on a blade, I get this in edit mode:

    During playback, it looks like this:

    But if I change the TEB properties and select the Show scrollbar option:

    I get this in the output:

    See you soon... Rick

    Useful and practical links

    Captivate wish form/Bug report form

    Certified Adobe Captivate training

    SorcerStone blog

    Captivate eBooks

  • How to get all the attributes of the component of action script

    Hello

    I'm new to flex. I use ActionScript 3.

    I have a component with the name template1.mxml. In this, I have 10 text boxes with the unique id

    I want to erase all the text boxes when the user clicks on the button "delete".

    For this feature, I need to wirte something like that

    "

    templateObj.name.text ="";

    templateObj.address.text ="";

    templateObj.city.text ="";

    templateObj.like.text ="";

    ".

    I have 25 models like this one, and all models have different attributes. The above code became cumbersome for me.

    Is there a way I can get the picture of the id attribute of the object then iterate over this array and write only one line

    Like that: -.

    for each (var i in templateAttrArray) {}

    templateObj.templateAttrArray [i] .text ="";

    }

    I tried the getChildren(); methods, but he's back, whatever it is.

    There may be solutions for this one?

    Any help appreciated.

    Thank you

    Tushar Gandhi

    Hi there, that should do it


    http://www.Adobe.com/2006/mxml"layout ="absolute">
       
            Import mx.controls.TextInput;
    private void clearAll (): void {}
    {for each (var ti: TextInput in {vbox.getChildren ())}
    TI. Text = "";
    }
    }
               
               
    ]]>
       

       
           
           
           
           
           
       

       

  • How can I get all the values of a set of DBMS?

    Hi all
    I use this «dbms_output.put_line (DBMS_DB_VERSION.» VERSION | '.' || DBMS_DB_VERSION. THE SHOW); "to display the version. But how do I get all the DBMS_DB_VERSION values? Is there a common way?

    Thank you.

    Best
    Laurence

    Hello

    Don't think it's possible. Even if that were the case, you would be able to use/display BOOLEAN type in SQL.

    If you aim just to see what they are, you could do something like that

    select text
      from all_source
     where owner = 'SYS'
       and name = 'DBMS_DB_VERSION'
       and type = 'PACKAGE';
    

    Or even

    select dbms_metadata.get_ddl('PACKAGE', 'DBMS_DB_VERSION', 'SYS') from dual;
    

    My version is:

    SQL> select * from v$version where rownum = 1;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    1 row selected
    

    11 g, you also have [PL/SCOPE | http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10471/adfns_plscope.htm#ADFNS02203] that might help you even more.

    Concerning
    Peter

  • All the text unreadable when I start Firefox

    When I restart my system Windows 7 and you run Firefox for the first time of the day, all the text is unreadable, as if all the letters of the words are compressed into a single space. This includes the tab names and text Web site. I think the screenshot that explains it better. When I quit firefox and run it again, the problem disappeared.

    Generally, we associate these problems of rendering with hardware acceleration.

    It can also be a problem with certain fonts that resolve to a reason any after a reboot.

    You can do a test of fonts to see if you can identify the corrupted fonts.

Maybe you are looking for