CS4 automatically resize the height of the text frame to the baseline of the last line of text

Hello

Does anyone know of a script that automatically resizes all the heights of text frame in a document so that the bottom of each text block falls on the baseline of the last line of text in the text block? The image height must be determined by the text appearing and does not effect excess or stories of threads.

Thank you!!

Chung

As text blocks have a property 'lines', lines have a property 'base' and executives have a 'geometricBounds' property, this quickly written javascript should do the trick for a block of selected text:

app.selection[0].geometricBounds = [app.selection[0].geometricBounds[0],app.selection[0].geometricBounds[1],app.selection[0].lines[app.selection[0].lines.length-1].baseline,app.selection[0].geometricBounds[3]];

(Whaddoyouknow: it can be done in one line)

So let's loop over all the text blocks in your current document:

allf = app.activeDocument.textFrames;
for (f=0; f 
         

Tags: InDesign

Similar Questions

  • InDesign automatically formatting the first line of text in a textbox?

    Hello

    My question looks very easy, but I can't find an answer anywhere.

    I like automatically formats the first line of text in a text box with the style of good character.

    I tried already different ways like GREP or styles nested.

    But I never had the right solution.

    I hope you can help me!

    See you soon,.

    Raphael Tebarts

    Well, it's not entirely "automagical", maybe someone knows better as well.

    1. you create nested Style special Para with the line Style.

    2. with grep \A[^\r]+ find all paragraphs in your text boxes and apply your new paragraph Style.

    For more information, take a look here:

    http://GraphicDesign.StackExchange.com/questions/37272/grep-apply-character-style-until-ca distribution-back

  • TextStyle.lineHeight on a label causes the last line of text to be cut?

    I have the following QML (hosted in a TabbedPane, so who could possibly make a difference):

    {Of container
    {Label
    text: "Lorem ipsum dolor sit amet, adipiscing elit computer."
    Multiline: true
    textStyle.fontSize: FontSize.XLarge
    textStyle.lineHeight: 0.8
    textStyle.color: Color.Black
    }
    }

    Setting the property textStyle.lineHeight to something less than 1.0 is what I expect, except that the last line of the text of the label is cut down. Any ideas how to get around this problem, or if I do something wrong?

    Screenshot of the results, a device Dev Alpha B running OS 10.0.9.348. Results look the same on the simulator of 10.1.

    It looks like a bug. As a solution, try adding "\n" at the end of the text.

  • C6280 sometimes cut the last line of text

    I was not able to understand this one... I do not get a margin in Word printing error, but the last line of text, even in the middle of a page the low 80% of it has failed.  It's as if the printer thinks it has reached a limit of impression, but this is no the case near the edge of the paper.  It is not just a problem with Word.  I was using Memorex, software for labeling this morning, and it's the same thing.  In this case, the omission was near the edge of the CD label stamped, but it was far from the edge of the paper.  Any help with this would be appreciated.

    It worked for me:

    1. go into your printers folder, right click on the connected network printer that you experience the problem with and select "Properties".

    2. when the Properties window opens, click the "Ports" tab

    3. at the bottom of the tab window Ports is a check box "Enable bidirectional support", uncheck the box and click 'OK '.

    now print something where you have already encountered the problem.   I think this might work for some users.

  • 4.1 Developer, the output of the Script window does not display the last line of the output automatically

    Hi all

    I use the new version of the developer 4.0.1.14 on Windows 7 x 64, I noticed that the result of the query or the output of the script does not display as before:

    When I run a query lets say with 100 lines of output, run the query successfully, but the cursor jumps automatically to the last record in the game as in all previous versions, I have to scroll manually everytime.

    Can I change this?

    Thank you

    No, unfortunately, it's a bug.

    It is not for all queries however. Still boring.

  • [CC14] [AS] [JS] Application of parameters of automatic resizing to a block of text

    Hello

    Anyone know how to apply settings of automatic resizing to a block of text with Applescript (or with Javascript - I'll translate it)?

    Thanks for your help!

    Given a block of text called myFrame, here is an example:

    myFrame.textFramePreferences.autoSizingType =

    AutoSizingTypeEnum.HEIGHT_ONLY;

    myFrame.textFramePreferences.autoSizingReferencePoint =

    AutoSizingReferenceEnum.LEFT_CENTER_POINT;

  • How to set the text in the last line of the table to be bold

    Hi all

    I have two tables in the report on my page and I would like to have the last line of the table as a "BOLD" text data.

    I found a jQuery selector to select the last row of the table, but I do not know how to implement it in the Apex. I want to control what table will have changed last row and who won't.
    $("tr:last").css({backgroundColor: 'yellow', fontWeight: 'bolder'});
    Could someone help me how to create a dynamic action to accomplish, or if y at - there another solution?

    My test app:

    user name: [email protected]
    passwd: kurintest
    appl: REPORT_APPL 12451

    Thanks in advance,

    Jiri

    Nico Martens wrote:

    PS: If you worry about sql plsql context switching, use a box instead of my function. Which probably could increase performance.

    Using this technique , analytics, and casewould be more effective and offer the best separation of concerns:

    Source report

    select
              product_id
            , sum(quantity_on_hand) qty
            , avg(quantity_on_hand) avg
            , case
                when   count(*) over ()
                     = row_number() over (order by product_id nulls last)
                then
                  'bold'
                else
                  'normal'
              end font_weight
    from
              oehr_inventories
    group by
              rollup(product_id)
    order by
              product_id nulls last
    

    HTML column expression

    #PRODUCT_ID#
    

    Avoid generating HTML in the query when it is possible that its impact on the ability to use the features of declarative report as column sorting and setting in the form. (See examples on page 3)

    If you have a table with 100 rows and you show only 15 lines. Do you want the 15th line "BOLD" or just line 100Le.

    It is really the important issue here. If the reports do not use paging and always show all lines, then it's trivial to implement using dynamic Action (as shown on page 2):
    H4. When

    Event: After refresh
    Selection type: jQuery Selector
    jQuery Selector: .report-standard

    H4. Real Action

    Action: Run the JavaScript Code
    Fire on loading the Page: Yes
    Code:

    $(".report-standard tr:last-child td").css({backgroundColor: 'yellow', fontWeight: 'bolder'});
    

    (Here is to use appropriate DA / jQuery selectors to make sure that only reports including totals get this formatting applied...)

    For more complex presentations, a report of custom line model is the way forward, as in the link in the previous thread of the OP: + {: identifier of the thread = 2436912} +.

    Also note that the columns hidden, based on the GROUP_ID/GROUPING/GROUPING_ID functions are very useful in these reports. They can be used to report conditions of line to avoid the additional conditions to be ready in the query (as in the case above) and provide the break several levels of formatting.

  • multicolumn ListBox scroll down to the last line - with AutoSize on

    Hello world:

    I have a question about scroll to the last row of a listbox multicolumn with a small twist: automatic resizing line Heght is on.

    I checked this point - listbox multicolumn - scroll down to the last element - but if one or several lines are automatically resized to have more than one line, then the actual number of visible lines differs from the numrows and the calculation ends up incorrect.

    Has anyone found how to do this?  If there is a property only to find the heght of a line in lines...

    Thank you!

    I developed what I think it's a solution to the test.  It is based on adding the line heights, in pixels, of the last row back, until it is greater or equal at the height of the content area of Listbox MC, also in pixels.  Add-on for the upper left row to display because the last line displayed can be split.  Thus, there is always an empty line at the bottom (which is the only way to ensure that the last message is completely visible).  Because of the way that LabVIEW scrolls lined with several lines, there may be several blank lines on the bottom.

  • InDesign CS6 fully justify won't fit on the left the last line of a paragraph.

    As Indesign CS6 does not seem to justify the last line of each paragraph to the left when I put it to justify fully in my paragraph styles is there a way I can automatically add a space without paragraph at the end of each paragraph?  The text for the book, I formatted is all part of a text as it has been imported the document of my client.  So I can't us the end of the story to rinse.  Help...

    It is withdrawal and spacing...

  • OfficeJet 6500 intermittently does not print half of the last line in the lower doc

    Using an Officejet 6500 E709a connected to Windows 7 64-bit PC via ethernet LAN.  Intermittently, the printer is unable to print a part of the last line of the document.  A 12 point font for example it does not print the bottom half of the letters on the last line of text.  What software (word, excel, PDF, etc.) and it does not matter hwer on the page of the last line falls.  It occurs only on the last page of multipage documents.

    Try that and see if it helps the question:

    1. In the Windows taskbar, click the Windows icon ( ), type control printers in the Search text box and press ENTER. The Printers window opens.

  • How to remove the last line of Utl_file

    Hi I have a requirement to write the output to a file. But everything I try the last line is coming as white. I can't understand why UTL_file last blank line as null. Is aby wat to fix this problem?

    /

    Declare

    Lfilehandler Utl_File.File_Type;

    Lfilepath varchar2 (100);

    Varchar2 (100) Lfilename: = "TESTFATCAFILEGEN.txt";

    Lhead VARCHAR2 (2000);

    Begin

    Dbms_output.put_line (' started read directories ");

    SELECT Filepath

    IN Lfilepath

    OF Interfacefileformathdrtbl

    WHERE Interfaceid = "FATCAPREXTFEED";

    Dbms_output.put_line ('found directory');

    Lhead: = ' this is a test generated file to test if the generation of the file that is happening or not. "

    Lfilehandler: = Utl_File.Fopen (Lfilepath, Lfilename, 'W');

    Utl_File.PUTF (Lfilehandler, Lhead |) '\n');

    Utl_File.fclose (Lfilehandler);

    Dbms_output.put_line ('generation of the file is complete");

    exception

    While others then

    Dbms_output.put_line ('down in the generation of file');

    Dbms_output.put_line ("sqlerr" |) SQLERRM);

    End;

    /

    UTL_FILE adds always new line at the end of the file if you use text mode. You must use the byte mode:

    Declare

    Lfilehandler Utl_File.File_Type;

    Lfilepath varchar2 (100);

    Varchar2 (100) Lfilename: = "TESTFATCAFILEGEN.txt";

    Lhead VARCHAR2 (2000);

    Begin

    Dbms_output.put_line (' started read directories ");

    SELECT Filepath

    IN Lfilepath

    OF Interfacefileformathdrtbl

    WHERE Interfaceid = "FATCAPREXTFEED";

    Dbms_output.put_line ('found directory');

    Lhead: = ' this is a test generated file to test if the generation of the file that is happening or not. "

    Lfilehandler: = Utl_File.Fopen (Lfilepath, Lfilename, 'WB');

    Utl_File.Put_RAW (Lfilehandler, UTL_RAW. CAST_TO_RAW (Lhead));

    Utl_File.fclose (Lfilehandler);

    Dbms_output.put_line ('generation of the file is complete");

    exception

    While others then

    Dbms_output.put_line ('down in the generation of file');

    Dbms_output.put_line ("sqlerr" |) SQLERRM);

    End;

    /

    SY.

  • It is possible to color the last line (or word) at the bottom of a page?

    Just to mark the end of the image in a page?

    Thank you.

    This sets the last line of each block of text in the document to an existing named red shade. If a problem might be jumping frames where you don't want to change, or what happens when the text is redéroule?

    Tell application "Adobe InDesign CS6"

    f the value of each block of text in the active document

    the value s swatch 'Red' in the active document

    Repeat with x in f

    -replace line with Word to get the last word

    The object reference of the last line of the content of the p-value x

    set the fill color of p to s

    end repeat

    tell the end

  • The line of the last line of each table page is going to be missing.

    Hi Experts,
    In OBIEE 11.1.1.6.0, I have a report contains more than one line. "When I click on" PDF "Print", the last line of each table page line will be missing. " Why?
    Are you facing the same case? How soluve this question? Thank you.

    Hey Kobe,

    The question, looks lke a bug. Here's the work around, change the table view, click the properties of content next to the text "Table" (at the top of the columns and measures) in the layout-> position In Border pane to choose custom and select only the bottom edge (horizontal line). Now export to pdf format, you must see the border for the last row on each page.

    Kind regards
    DpKa

  • How can I update the last line in a file.

    Hello

    I need to add text that should be on the 2nd last line of a text file. I get the last line using RandomAccessFile and surroundings,
            fileHandler.seek(fileHandler.length()-1-lastLine.length()-1);
            
            fileHandler.writeUTF("last_line\r"+lastLine.replaceFirst("0x00", "0x80"));
    updated the code above, I'm trying to add the text to the last line. But instead of add, the above code simply replaces the last line.
    How to solve this problem?

    BR
    Umer

    Just by adding a single line to rewrite the entire file may not be a good idea eapscially when the file is in MBs. so that is the reason why I use RandonAccessFile,.

    You don't know that? HDs store files on several trays at the same spot on the Board, so you won't lose anything in rewriting.

    I have also an other question. In other words, how I can I know the last line is achieved using PrintWriter?

    Steps to follow:
    1. read the entire file into a string
    2. parse the string by using the String.lastIndexOf ("\n") to the last character of line break.
    3. use printwriter to write the string up to the last line (use string.substring), then give your new data, and then enter the second part

    >

    BR
    Umer

  • View the last line of a JTextArea wrapped in a get

    I use a JTextArea to permanently display the generated text of asynchronously and sporadically. The JTextArea is encapsulated in a get. When new text is added to the JTextArea I need to always show the last line of text. The only solution I've found so far is to find the length in characters of the text and before the JTextArea #setCaretPosition (). I can't believe that this is preferable, because to find the character length means first to convert the content of the JTextArea in chain!

    Is there a better way to do this?

    Use the javax.swing.text.Utilities class. Method
    mutable public static int getRowStart (JTextComponent c, int OFFS)

    You can pass the length of the document and your JTextArea.

    Or just use textArea.setCaretPosition (textArea.getDocument () .getLength ())

Maybe you are looking for