How to select each lower word end of line

Dear friends,

I need your help.

@Just: I need to select one word to each line and each last paragraph below.

I have attached example screenshot below:

Untitled.png

Thanks in advance

Try this:

try {
    // gets the lines from the first paragraph in the first story of the active doc.
    var lines = app.activeDocument.stories.firstItem().paragraphs.firstItem().lines;
} catch(e)
{
    alert("This script needs an InDesign document to be open whose first story is not empty");
    exit();
}

var lineCount = lines.length;
var shortestWord = null;
for (var x = 0;x < lineCount;++x)
{
    lastWord = lines[x].words.lastItem();
    if (shortestWord == null || lastWord.length < shortestWord.length)
    {
        shortestWord = lastWord;
    }
}

shortestWord.select();

Tags: InDesign

Similar Questions

  • How to select the paths with the same line width

    I would like to know how to select all the paths within a document whose line width are equal at 0.361 points

    I'd appreciate any help.

    Here you go

    #target illustrator
    
    // script.name = selectPathsThisSize.jsx;
    // script.description = selects pathItems that have the same supplied stroke width; limited to 3 decimals;
    // script.required = a document with at least one path item;
    // script.parent = CarlosCanto // 6/5/11;
    // script.elegant = false;
    
    var idoc = app.activeDocument;
    var strokewidth = prompt ("Enter Stroke Width in points of paths to be selected", 0.361, "Select Paths this size:___");
    
    for (i=0 ; i< idoc.pathItems.length; i++)
         {
              var ipath = idoc.pathItems[i];
                   if ( (ipath.strokeWidth).toFixed(3) == Number(strokewidth).toFixed(3))
                        {
                             ipath.selected = true;
                        }
         }
    
    app.redraw();
    
  • How to select each next user activity

    I have a data as below

    Select 1 as userid, 'I' Act, double sysdate
    Union of all the
    Select 1 as userid, 'I' Act, sysdate + 1 double
    Union of all the
    Select 1 as userid, 'C' law, sysdate + 2 double
    Union of all the
    Select 1 as user name, 'C' law, sysdate + 3 double
    Union of all the
    Select 1 as userid, 'I' Act, sysdate + 4 double
    Union of all the
    Select 1 as userid, 'C' law, sysdate + 5 double
    Union of all the
    Select 1 as user name, 'C' law, sysdate + 6 double
    Union of all the
    Select 1 as userid, 'C' law, sysdate + 7 double
    Union of all the
    Select 2 as username, 'C' law, sysdate + 1 double
    Union of all the
    Select 2 like userid, 'C' law, sysdate + 2 double
    Union of all the
    Select 2 as username, 'C' law, sysdate + 3 double

    O/P

    Law on the user Date
    --------------------------------
    1. I HAVE 24-SEVEN.-10
    1. I HAVE 25-SEVEN.-10
    C 1 26-SEVEN.-10
    1 C 27-SEVEN.-10
    1. I HAVE 28-SEVEN.-10
    1 C 29-SEPT.-10
    1 C 30-SEVEN.-10
    1 C 1 OCTOBER 10
    2 C 25-SEVEN.-10
    2 C 26-SEVEN.-10
    2 C 27-SEVEN.-10

    Now, I want to select all the activity of C of a user who was held following immediate from C
    that is on top of the data I need to select


    Law on the user Date
    --------------------------------
    1 C 27-SEVEN.-10
    1 C 30-SEVEN.-10
    2 C 25-SEVEN.-10
    2 C 26-SEVEN.-10
    2 C 27-SEVEN.-10

    Can someone help me please?

    OK, then you can use LAG analytical function to retrieve the previous law for each line within groups of USERID:

    WITH t AS (
     select 1 as userid, 'I' act, sysdate dt from dual union all
     select 1 as userid, 'I' act, sysdate+1 from dual union all
     select 1 as userid, 'C' act, sysdate+2 from dual union all
     select 1 as userid, 'C' act, sysdate+3 from dual union all
     select 1 as userid, 'I' act, sysdate+4 from dual union all
     select 1 as userid, 'C' act, sysdate+5 from dual union all
     select 1 as userid, 'C' act, sysdate+6 from dual union all
     select 1 as userid, 'C' act, sysdate+7 from dual union all
     select 2 as userid, 'C' act, sysdate+1 from dual union all
     select 2 as userid, 'C' act, sysdate+2 from dual union all
     select 2 as userid, 'C' act, sysdate+3 from dual
    )
    SELECT userid, act, dt
    FROM (
     SELECT t.*,
            lag(act) over(partition by userid order by dt) prev_act
     FROM t
    )
    WHERE act = 'C'
    AND prev_act = act
    ;
    
  • How to select each row in a table where there is no user input?

    My order is: DUMMY_BLK. It has field: NWTFR.

    My basic block is: T_UNLDLD_BLK.
    In the palette of the property, where clause is: ULD_RPTNO =: DUMMY_BLK. NWTFR

    When the user presses the search button, it gets results according the unindexed in report. My trigger when-pressed key contains the following code:
    go_block ('T_UNLDLD_BLK');
    execute_query;


    If the NWTFR is null, I should get displays all records in the T_UNLDLD table.

    How can I do that, I need to add to the place where clause please?

    Thank you.

    Hai,

    change the where nearby

    ULD_RPTNO LIKE NVL(:DUMMY_BLK.RPTNO, '%');
    

    Kind regards

    Manu.

    If this answer is useful or appropriate, please mark. Thank you.

  • How to select and default hightlight the first line in a programmatic Table(ADF Table created based on a SortableModel) ADF.

    Hi all


    We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.


    We created a table ADF programming related to a SortableModel created programmatically to a bean.


    We need to select and highlight the first row in the table just after making it to retrieve data based on the first line.


    We tried the based on the following thread: How to call the bean support just after JSFF / page fragment loads? and a few other posts online, but it does not work very well.


    W has created a hidden text in the bottom of the JSF model as follows:


    < af:table varStatus = "rowStat" Summary = "table" value = "#{pageFlowScope.crudBean.dynamicTable.collectionModel} '"

    Rows = "#{pageFlowScope.crudBean.dynamicTable.collectionModel.RowCount} '"

    contentDelivery = 'immediate' var = 'row' rendered = 'true '.

    Binding = "#{backingBeanScope.crudBackingBean.tasksTable} '"

    selectionListener = "#{backingBeanScope.crudBackingBean.customListener} '"

    "rowSelection ="single"id ="t1"partialTriggers =": pt_gr2 "columnStretching =" column: clmn0 ">

    < af:forEach items = "#{pageFlowScope.crudBean.dynamicTable.columnNames}" var = 'name' varStatus 'vs' = > "

    < af:column sortable = "true" sortProperty rowHeader = "#{name}" = "no style" headerText = "#{pageFlowScope.crudBean.dynamicTable.columnLabel [name]}" "

    inlineStyle = "width: 100px;"  ID = "clmn$ {vs.index}" >

    < af:activeOutputText value = "#{row [name]}" id = "aot1" / >

    < / af:column >

    < / af:forEach >

    < / af:table >

    ....


    < af:outputText id = "hiddenOutputTextId" visible = "false" value = "#{backingBeanScope.crudBackingBean.afterPageLoad} '"

    Binding="#{backingBeanScope.crudBackingBean.hiddenOutputText}"/ >

    And we have added the code to the bean to support below:

    public String getAfterPageLoad() {}

    If (!.) {AdfFacesContext.getCurrentInstance () .isPostback ()}

    selectFirstRowInTasksTable();

    }

    Return afterPageLoad;

    }

    public void selectFirstRowInTasksTable() {}

    try {}

    RKS RowKeySet = new RowKeySetImpl();

    RowKeySet rksEmpty = new RowKeySetImpl();

    Model CollectionModel = tasksTable.getValue ((CollectionModel));

    ROWCOUNT int = model.getRowCount ();

    If (rowcount > 0) {}

    model.setRowIndex (0);

    Key of the object = model.getRowKey ();

    RKS. Add (Key);

    tasksTable.setSelectedRowKeys (rks);

    SelectionEvent selectEvent =

    new SelectionEvent (tasksTable.getSelectedRowKeys (), rks, tasksTable);

    selectEvent.queue ();

    customListener (selectEvent); / / to retrieve data

    AdfFacesContext.getCurrentInstance () .addPartialTarget (tasksTable);

    }

    } catch (Exception e) {}

    }

    }

    I think that () selectEvent.queue; should work even without calling the customerListener, but it is not working in all cases.

    What is the problem in my code?



    Have you tried to bind property of 'selectedRowKeys' to selection configuration / bean there?

    Something like:

    public RowKeySet getSelectedRKS() {
        if (rks == null) {
            // make first record as selected
            // create RowKeySet and assign it to rks variable(where rks is variable defined in bean with some scope higher than request scope)
        }
        return rks;
    }
    

    Dario

  • How to capture and display the end of line character in the report

    Hi guys,.

    I have a report that we are poster campaign ID, campaign name, and Description of the campaign.
    The result is coming like this

    Description of campaign campaign campaign ID name
    1 ABC 1 Plan June 13. 2 market July 1. 3. end July 30.
    Plan XYZ 2 1 13 June. 2 market July 1. 3. end July 30.

    But we want the data to be displayed in the following format.

    Description of campaign campaign campaign ID name
    1 ABC 1 Plan June 13.
    2 market July 1.
    3. end July 30.
    Plan XYZ 2 1 13 June.
    2 market July 1.
    3. end July 30.
    That the user has the possibility to enter several lines for the description in front end Application & want us to show the same way Description. How can I capture this end of the character in ETL? If he is already captured, then how to show in the report.
    I use Siebel as before end application and for the ETL using Informatica.

    Any help will be much appreciated.

    Thank you
    Rupesh

    OBIEE presentation Service is an HTML element based on software then it does not show the end file character CHR (10) or Chr (13).
    You must replace this with the HTML tag charcaters
    .

    I'm not sure of the name of the function, but you must make a formula like this

    replace(mytable.mycolumn, chr(10), '
    ')

    See you soon
    Nico

  • How to highlight continue 3 Word of hyphen-nit end line

    Dear friends,

    I need your help!

    How to highlight the word continue 3 line end hyphen-nit? Screenshot below.

    Screen+Shot+2016-02-12+at+11.22.00+PM.png

    I did highlight for all the word of hyphen-nit (here is my code). But I need to highlight to continue 3 line hyphen-nit words only. Otherwise no. need simple and double highlighted of hyphenated words. Please suggest friends

    My code:

    var doc = app.activeDocument,    
        _stories = doc.stories;    
    for(var i=0;i<_stories.length;i++)    
    {    
            var _lines = _stories[i].lines;    
            for(var j=0;j<_lines.length;j++)    
            {    
                    if(_lines[j].words[-1].lines.length >= 2)  
                    {  
                            _lines[j].words[-1].fillColor = "Green";  
                        }  
                }    
        } 
    

    Thanks in advance

    Hi Marlon

    If you are looking to highlight all occurrences of last words of 3 or more consecutive, you can try.

    I do not pretend that it is a particularly effective way to do it.

    function color3PlusHyphenateted() {
        var doc, stories, n, l, lastWords, firstWords, hyphenateted, e, i, lwl, HReg;
        HReg = /HHH+/g;
        doc = app.activeDocument;
        stories = doc.stories.everyItem().getElements().slice(0);
        l = stories.length;
        for (n = 0; n < l; n++) {
            lastWords = [0].concat([], stories[n].lines.everyItem().words[-1].getElements().slice(0));
            firstWords = stories[n].lines.everyItem().words[0].getElements().slice(0);
            lwl = lastWords.length;
            hyphenateted = [];
            for (i = 1; i < lwl; i++) {
                hyphenateted[i] = (lastWords[i] === firstWords[i]) ? 'H' : '0';
            }
    
            hyphenateted = hyphenateted.join('');
            while (e = HReg.exec(hyphenateted)) {
                for (i = e.index + 1; i <= HReg.lastIndex; i++) {
                    lastWords[i].fillColor = doc.colors[3];
                }
            }
            HReg.lastIndex = 0;
        }
    }
    app.doScript(color3PlusHyphenateted,ScriptLanguage.JAVASCRIPT,undefined, UndoModes.ENTIRE_SCRIPT, 'color3PlusHyphenateted');
    

    If you select only all occurrences of exactly 3 consecutive words in last hyphen, change the line

    HReg = /HHH+/g;
    

    TO

    HReg = /HHH/g;
    

    HTH

    Trevor

  • How to find the words that spans end of line to the next line in pdf format?

    I use Adobe Acrobat Pro X version for our development and form maintenance. I am writing a command Acrobat JAVA script which reads through all words and run the spell check and reports the wrong words spelled in an excel sheet. Because I run this script in batch for more than 1000 PDFs - I get a lot of words together. When I looked in the PDF files all these words are good looking because it makes its appearance at the end of the right margin, and the next word is in the next line. Since there is no space between them, it was mined in one word. Where the failure.

    I have used wordf = this.getPageNthWordQuads (i, j) to get the word start and end coordinates. When I look at my values create a rectangle, and extending through the lines. I got the coordinates for the ordinary Word and which cover the two lines acoross. the coordinates are same.

    I think I'm screwed I 8000 words and not the slightest idea how to get rid of them actual misspelled words.

    Help, please. Let me know if any /method class so I give the speech will give me the end of line or I have to go to the next layer to find this split.

    the addnot is somehow marking the words using this contact information - please hellp understand me how this works. Thank you.

    for all pages

    for (var i = 0; i < this.numPages; i ++)

    {

    For all words

    PG += 1;

    numWords = this.getPageNumWords (i);

    for (j = 0; j < numWords; j ++)

    {

    get spell checking

    ckWord = spell.checkWord (this.getPageNthWord (i, j))

    If (ckWord! = null)

    {

    Jn = 0

    ml = 0

    If the misspelled word found.

    wordf = this.getPageNthWordQuads (i, j)

    swordf = wordf.toString)

    var St = swordf.split(",")

    var diffx0 = parseInt(st[0])-8

    var diffx1 = parseInt(st[1])-8

    var diffx2 = parseInt(st[2])-8

    var diffx3 = parseInt(st[3])-8

    var diffx4 = parseInt(st[4])-8

    var diffx5 = parseInt(st[5])-8

    var diffx6 = parseInt(st[6])-8

    var diffx7 = parseInt(st[7])-8

    If (bparole is csword)

    {

    Jn = 1

    }

    If (m [1]! = m [3])

    {

    ml = 1

    }

    dataLine += "\r\n writing".

    }

    on the other

    {

    ml = 2

    }

    dataLine += "\r\n"+this.documentFileName. "

    + "\t" + this.getPageNthWord (i, j)

    + "\t" + pg

    + "\t" + j

    + "\t" + ml

    + "\t" + jn

    '\t st [0]' + diffx0 + '\t m [1]' + diffx1 + '\t st [2]' + diffx2 + '\t [3] st' + diffx3

    '\t st [4]' + diffx4 + '\t st [5]' + diffx5 + '\t [6] st' + diffx6 + '\t st [7]' + diffx7

    CK = 1

    }

    }

    }

    If Acrobat is reading each part of the word and the distinct words, you have a problem.

    The way I approached it in some of my tools was to check if a word ends

    with a hyphen and if so, to check if it is the last one on the line. If the two

    conditions are met, combined with the word on the next line. It comes

    do not fool proof, of course, as there are documents with columns are another

    structural elements that prevent this from working. Better than nothing,

    Although...

    However, it is also possible that Acrobat sees both as parts of

    the same word. In this case, getPageNthWordQuads() returns several

    tables of quads. As you know, this method returns an array of arrays quad.

    He is usually alone, but in principle it could be more... Something

    to check before giving up.

  • How to execute each block in a canvas close while that select the tab?

    Hi all

    How to execute each block in a close canvas by selecting a tab? I mean when I select a specific tab in a canvas tab that records should run. How can I configure this?



    Arif

    Arif,

    Make sure that the correct block name is used in the GO_BLOCK statement. As directed by your post, you try to navigate to USERDELETION block when the tab page is USER_CREATION_LIST. Modify the code to

       IF GET_CANVAS_PROPERTY('CAN_SUPERVISOR', TOPMOST_TAB_PAGE) = 'USER_CREATION_LIST' THEN
          go_block('USERCREATION');
          execute_query;
       ELSIF GET_CANVAS_PROPERTY('CAN_SUPERVISOR', TOPMOST_TAB_PAGE) = 'USER_DELETION_LIST' THEN
          go_block('USERDELETION');
          execute_query;
       END IF;
    

    Kind regards

    Manu.

  • How to select the values for each check box in a group of records

    Hello

    I have a requirement in form 10g. In this form there are 10 records are display each record has a checkbox is there if I click on the check box save number one and number three and make some changes in the text field (field adjustment is the number data type) and then finally, I want to see the total a total amount called field.

    In this, my question is how to select specific to a group of records records? and finally these selected records are inserted in a table.
    Because I am not able to read these records at a time.
    Is there any table to define a record group to fetch each of them individually for example Rec [1] Rec [2]... like this if yes please suggest me the steps how to do this.

    Thanks in advance
    Prasanna

    Published by: user10315107 on December 17, 2008 23:44

    OK, so you want to shoe the total amount in the form itself (I guess that somewhere under the dashboard lines?).

    You can do this easily using formulat elements:

    1 create a new item in your block where the field amount is places, set "section of the database" on the 'No', 'calculation mode' to the 'formula' and the 'formula' himself to something like:

    CASE WHEN :BLOCK.CHECKBOXITEM=CHECKVALUE THEN :BLOCK.AMOUNT+:BLOCK.ADJUSTMENT ELSE 0 END;
    

    This formula returns 0 if the checkboxitem is not checked, otherwise the sum of amount and adjustment (of course you can adjust the names of elements and the value for 'Checked')
    2. place the element in the layout, if you wish.
    3. set the property "Query all Records" to "true" for your block elements, this is necessary for the calculation to work
    3 create a control block to keep summary article in a, "Single Document" set to 'True '.
    4. place a new element in this control block, set 'Calcuation mode' to 'Summary', 'Summary block' to your block elements, 'Summary point' in newly created formula section in the block elements
    and function of synthesis for the "sum".
    5. place the element in the layout

    She's.

  • How to select and move more than one bookmark at a time? Shift + click selects multiple items that are next to each other in a list, because the element

    How to select and move more than one bookmark at a time?
    Shift + click selects multiple items that are next to each other in a list, because the items open in firefox before that happens.

    Glad it worked for you. Thanks for posting back.

  • I really need someone to help me. I tried to figure out how to select a PDF to convert a Word doc. When I go to select a PDF file, all that comes is the WORD documents. doesn't show ANY of my PDF files... Please help me understand wh

    I really need someone to help me. I tried to figure out how to select a PDF to convert a Word doc. When I go to select a PDF file, all that comes is the WORD documents. doesn't show ANY of my PDF files... Please help me understand what is happening? We put it on automatic renewal so I know it's not that we have not renewed this subscription, because we pay automatically.

    Hi olivias,.

    Looks like there may be some confusion on your system which application should be associated with PDF files. You can reset the file name associations by following the steps described in these articles (depending on your operating system):

    How to change the default application for a file type. Macworld

    http://Windows.Microsoft.com/en-us/Windows/change-default-programs#1TC=Windows-7

    Please let us know if you have any additional questions.

    Best,

    Sara

  • After I converted the PDF to Word how to select some pages to save as a new document? Thank you

    After I converted the PDF to Word how to select some pages to save as a new document? Thank you

    You said you have a Word file and use certain pages in the file to create a new document.

    Use Word to create a new Word file that has the pages you want for the original Word file.

    You now have a "new document" desired pages.

    With Acrobat Standard or Pro installed, you can create a 'new document' PDF.

    If you don't have Acrobat Standard or Pro, or a subscription to an Adobe online service that can create PDFS from MS Word, you can use the Microsoft process to create PDF that comes with MS Word.

    Be well...

  • How to select one of the VMRC and WebMKS of vRealize of automation for the end user

    As you know, there are two Protocol to use the remote console to the configured virtual machine of vRealize Automation. I know how to select one of the VMRC and WebMKS on vCenter via Web Client, but I'm not sure whether vRealize Automation can select one of the VMRC and WebMKS. Is there anyone who knows about it?

    You can set in the law.

    Grant

  • When I use hotmail in FF any word ending in s is highlighted as an error

    When I use my hotmail in FF any word that ends with an "s" is underlined in red as an error. The word 'end' is stressed right now. How can I stop this!

    You can see which dictionary is selected if you right click in a text box and open the submenu language.

    Open the "Add Dictionaries" link to install a dictionary if you don't.

    Make sure that [X] "check spelling" pop-up menu is selected.

Maybe you are looking for