Calculate the length of the lines of text

In a script, I'm inserting text which is a 4 line poem. Each line except the last ends with a hard return ('\n'). I would like to calculate the length (in inches or in another unit of length) of each individual line to find the longest line and adjust the left indent accordingly. Is it possible to get the length of a line of text in a script?

Thank you!

A return is \r

\n is a soft return

Take a look through the comments here

http://InDesignSecrets.com/setting-poetry-flush-left-Center-on-longest-line.php

Tags: InDesign

Similar Questions

  • Online image are not not under the line of text above it

    I'm laying the pictures in a text box in InDesign and there are times where the image I put down this line of text quite where it the image is not overlap any text. And there are other times when the image does not move down enough and he ends up falling on top of text. After some trial and error, I realized that the paragraph style that is attached to the paragraph where sits the image is what affects this behavior. I just can't understand what in this style is causing that. I hope that makes sense. I have attached pictures to explain what is happening.

    In this first picture you can see that the paragraph mark is sitting in the lower corner of the image. The 'faq answer' paragraph style is applied here, and the image is located below the line of text.

    Screen Shot 2016-01-21 at 3.20.58 PM.png

    In this example, the same paragraph has the "topic" paragraph style applied, end-to-end it image overlaps the text above it.

    Screen Shot 2016-01-21 at 3.20.42 PM.png

    In the first case that anchored the line spacing of the paragraph with the image has the value auto, in the second, she has a fixed value.

  • Add the line of text in the list box

    Hi all

    I am trying to add lines of text programmatically,

    I am tiring to implement is a simple terminal for my software of text in order to display text messages.

    My problem is that I need to add lines of text of different vi.

    Can one recommend a good approach?

    Kobi Kalif wrote:

    1. with the reference: how to change a value from array in the Subvi

    2. with the process: if I update a value in the table, then the entire table inserts into the property in my list, so basically he rewrite the entire table to the list of all changes, is it not a bit wasteful?

    1.

    2. that's what you do for normal matrices as well.

  • HP Officejet Pro L7590 all-in: HP officejet Pro L7590 prints 1/2 of the line of text on several lines of the document

    I received an email for the diagnosis of the printer and I was prompted to install the updated drivers and I did it and now when I print the test page, I get several lines of text that displays only the top or the bottom 1/2 letters across the page, I printed a self-test diagnostic Page and printed everything in pink , but it does not print 1/2 letters across the page as a test page, then I printed a page of print quality and it did the same as the test page and it does the same thing as the test page, then I tried calibrate spacing of thought which may fix the problem but does not , what can I do?

    Irven

    Hi mmcmret8,

    Thank you for your answer! It is possible that the print heads may need to be changed, at this point, I would recommend to you please call our hotline at the 800-474-6836. If you do not live in the United States / Canada region, please click the link below to get help from your region number. Language-country selector.

    Best regards!

  • More help for a beginner! Cannot get rid of the lines of text box.

    I did this document and when I export I can still see the lines around the text in the rectangle tool. How can I get rid of these? Can someone help me? Thank you!

    Screen Shot 2014-11-25 at 09.57.50.png

    I think you put a "line" around them. Select them and change the weight to 0.

  • How to connect the line of text from one page to another?

    I'm working on a document with a line of text on the title page that I want to repeat on the footer. My goal is to be able to change the text on the title page and automatically update to match on the footer. Can you please suggest the best way to go about this? I started to try hyperlinks and anchors text, but was not able to find a solution yet.

    Search on how to use text Variables in the help. In this case, you probably want to get your title paragraph style.

  • Cannot delete the empty space of the Interior of the line of text

    I use Indesign CS3 on PC, Windows 7. I have a manuscript with 100s of hours invested. In the middle of about 5% of the pages, I have spaces unremovable (1 or 2) the text. The location is about the location in the center of the page the extremely tiny blue square. When I move the slider tool above the paragraph text, it shows dark black with the exception of unremovable space that shows white. Desperately need help!

    I wonder if there is something that we cannot see it on the Master Page that dress him the text. As an experiment, try selecting the text frame on the Master Page (or any Page of the issue) and go to the object menu > Options of text block, in the lower left corner of the dialog box, check "Ignore the text of not dress" and press OK.

    If nothing changes, then my theory is wrong. If this solves the problem, you will need to get the rectangle at the origin of this problem of Wrap on the Master Page and delete it.

    Sorry, I have not seen above Will suggestion. I would try the above anyway, just in case there is a rectangle hidden behind the Master Page text frame.

  • How to space out the lines of text more closely

    Just upgraded (?) FF25 and lines between the text (the ' leader' in the terminology of the police of my favorites) and other lists are widely spaced. It is really difficult to read and should be condensed. Anyone has an idea on how to achieve this? I checked all the customizable options with no result. Thank you.

    O.M.G. as they say. Everything worked and therefore all simply! Followed every step, following the instructions, and he was there - a normal list of bookmarks and the list of history, etc.. It's pretty gold, and you know your stuff. I really appreciate your help. Thanks, jscher!

  • Can help you with the resizing of the lines and text fields?

    Acrobat X Pro - I lost the feature on my text fields and lines to resize slice and dragging a box in small increments.  Everything is now resize to the size of the original box or the underscore.  Features to make my diagonal lines (to make an 'X') also lost.

    Is there a way to bring my function to move and resize in small amounts instead of the size of the original box or a button that I disabled?

    Maybe (?) Turn off align it on the grid.

    Be well...

  • calculate the lines of the nearby tables

    Hi all

    I have 2 tables, we're above the other on the page.   They are named "majtable" and "eductable", all rows from both tables are named "row" and all the cells to the columns to add are all named "determines".

    Here's my formula in formcalc (event of calculation)

    sum (majtable.row [*] .mhours [*] + eductable.row [*] .mhours [*])

    It is is saved as dynamic and dynamic/interactive preview.

    It won't add the cells determines for the two paintings together.  I can get a table to calculate or the other, but not both.  Should I rename the cells in one table column another thing than 'determines' (I didn't because the tables are called differently).

    I have many, many tables that add very well through the pages and have several tables.  But it will not work.  I did wrong, or maybe there's a bug / the file is corrupted.

    Thanks for any help!

    Hello

    The sum() function has parameters separated by commas. So, this should work:

    $ = sum(majtable.row[*].mhours, eductable.row[*].mhours)
    

    In addition you just use the joker for the stretch line.

    Hope that helps,

    Niall

  • Change the gap between the lines of text and headings

    Hi is there a good way to change the gap, in this case I

    want to reduce the gap/height between < p > text and

    topics.

    I'd rather do no use the height of line in CSS because I find it displays differently through browser.

    an idea - I'm on CS4

    Thank you

    Mark

    Just use CSS to change the margin of the bottom of the topic and the upper margin of the p tag.  I certainly wouldn't margins negative, even though, as there is no need to go to this extreme.  Consider something like this-

    H1 {}

    margin-bottom: .5em;

    }

    {p}

    margin-top: .5em;

    }

    With this, all the title tags and p will be half as far they are normally.  Make sense?

    Murray

  • How to put the line of text at the beginning of the text box?

    Hi dear friends,

    I have an input_txt which is an instance of TextArea

    When I type it in and press enter it captures.

    I need set the empty text box.

    If its been like

    input_txt. Text = "";

    But by doing like this prompt stays on the second line because support us on enter key.

    Is there a way to bring the prompt back at the beginning of the text box?

    Thank you

    Oh, I see your problem. It's because of what Raymond mentioned in your other thread - read his response to your response.

    The texts of TextArea of compensation when I press the Enter key

  • Two characters of kerning affects many couples throughout the line of text

    Hello

    I try to kern characters in InDesign CC 9.1, and when I use either the arrow keys or switch value, multiple character sets to move - not only the pair where the cursor was inserted. This happens with the two system fonts and purchased fonts and is so really hard to kern, well, because as a pair fits where I want to, another pair is to throw out of whack.

    I don't know what is the source of the problem. Is it possible to fix this? Thanks in advance!

    RDS

    This could also happen if you use the justification of the text.

  • Attempt to modify a pdf file - is there a key to strikeover for the current text of the line through text without deleting the text Moose?

    I need to cross out text on a PDF that I am editing.  bar like that but I can't seem to locate this key on the page where I am editing the pdf file in adobe.

    Where can I find it?

    Hi dhillionflygirl,

    You can find a tool in the comments pane in Reader and Acrobat.

    Please let us know if you have any additional questions.

    Best,

    Sara

  • Back to the line of text in the label

    Hello

    My used label text is originally the scroll bars to appear when the text of the label is a bit longer.

    Note that the label "< mx:Label text="{day0[0].dayPart0[1].dayDesc}"/ >" is one who has texts longer and smaller which is causing scrollbars to apper.

    Is it possible to add word wrap in the text of the label? I want to avoid adjusting the ' width ' of aggregate demand: -.

    < mx:HBox id = "fiveDaysBox" width = "100%" height = "100%" horizontalGap = "0" backgroundAlpha = "1" >

    < mx:Panel id = "tomorrowPanel" title = "Tomorrow" width = "100%" height = "100%" paddingLeft paddingRight = "0" = "0" horizontalAlign = "center" >
    < mx:Label width = "60%" text = "date:" / >
    < mx:Image source="{iconSmallPrefix}{day0[0].dayPart0[1].dayIcon}"/ >
    < mx:Label text="{day0[0].dayPart0[1].dayDesc}"/ >
    < mx:HRule width="60%"/ >
    < / mx:Panel >

    < / mx:HBox >

    Please suggest.

    Thanks and greetings,

    Amey

    Hello

    I think that if you have a long text in the mx:Text, and if you set a specific width for this, he would wrap the text automatically. In the following text code would be automatically be wrapped at the specified width.

    Width = "100" / >

Maybe you are looking for

  • Firefox 8.0 moved my homepage at the far right corner button. How can I move it back where it was on the left side?

    I read the help section, but none of this seems to answer this question.

  • HP pavilion 500-003 has drivers windows 7

    I just want to know why there is no driver file for Windows 7 by using the HP Pavilion 500-003. I recently bought a new computer with Windows 8 pre-installed on it. I don't like Windows 8 and want to go back to Windows 7, as some programs that I use

  • 2 switch &amp; 2 VLANs

    Hi, I'm a new user and struggling for the next step... I have 2 switches SRW224G4P and SRW248G4P. I created VLAN1 and VLAN2 on both switches. In each single switch, VLAN work correctly. But how 2 switch can announce their ports VLAN1 and VLAN2 and wo

  • Wiping of Windows 7 and reinstalling

    So, apparently, I have either a defective battery or Windows 7 is not properly read the ability. I am very experienced with PC and never leave my overload of the battery, but Windows is reading that it holds only an hour. I don't know if I need a new

  • Administrator cannot access folders in Windows 7

    I have a new computer and I am the administrator. I've implemented a new guest account and he was denied access to a folder. However, the administrator can no longer access this folder at all. Even when the administrator account can access the folder