[AS] get overset content in a cell

Hi Everyone,
I have a script that tags stories with HTML tags based on the style sheets in use.
It also creates HTML tables from InDesign tables.
The problem I'm having is that when a table has a "special style", such as bold or italic, the tags may cause the cells to overset and the the contents get "cropped". If the tags cause the cell to be completely overset, then the contents of the cell returns "" (nothing at all).
Is there a way around this connundrum?
Right now, I'm manually expanding the columns of tables to make sure there is room enough so no oversets!
Thanks!

Hi Allison,
Which scripting language are you using? Anyhow find my Javascript and Applescript code below.
//Javascript
    tables[0].cells[i].texts.item(0).contents
//Applescript
    text 1 of cell item i of table 1
Thanks
Thiyagu

Similar Messages

  • How do I accurately detect overset contents when using tables?

    Hello, all. I am familiar with how to detect overset contents of a text frame, namely:
    if ( myTextFrame.parentStory.contents.length > myTextFrame.contents.length) {
      alert('There is overset text');
    } else {
      alert('There is no overset text');
    However, the contents of my story are three tables, rather than text. Each table contains dozens of cells filled with text. Yet the "length" property of the frame is only 3! How do I accurately read the length of the content given that most of it is in tables so that I can test for overset text?
    In case it helps anyone, a more detailed description is:
    If there are three tables in the story, and only 2 fit on a page-sized text frame, the length property of that frame will be 2. Kind of weird, but not a problem yet.
    In the same scenario, however, if the third table BEGINS on the page but spills over (creating an overset situation), the length property of that frame will be 3 -- causing the test think there is NO overset text! InDesign simply sees 3 characters in the story, and only 3 characters on that page.
    When I look at the "contents" property of the story, it just reads 3 squarish characters. They're obviously some kind of special character. InDesign apparently takes the concept of "table" and just writes a placeholder character for it in the "contents" property.
    Am I going to have to create some routine to loop through every cell of every table and somehow add it all up to get a proper length? How do I just test for overset-ness?
    Thank you!

    Actually, Harbs, I'd already just burst my own bubble by running additional tests! So I have to revise my whole set of instructions.
    IGNORE EVERYTHING I WROTE ABOVE.
    Here is the revised solution, based on the initial solution proposed by Dirk and then revised to work around Harbs bug discoveries. It is essentially a corrected version of Dirks line. Instead of saying:
    app.activeDocument.stories.item(0).tables.lastItem().cells.lastItem().insertionPoints.last Item().parentTextFrames.length
    you would say:
    app.activeDocument.stories.item(0).tables.lastItem().cells.lastItem().parent.parent.insert ionPoints.lastItem().parentTextFrames.length
    That's just the short version. Here's the full code and explanation:
    Summary of problem:
    InDesign treats a table as a single special character, so it does not accurately report the "overflows" property of a text frame containing a table which spills beyond its margins. A text frame will show as not overflowing (i.e. myTextFrame.overflows will return false) if its final table simply begins within its margins--even if most of the table spills well beyond the text frame. So a ten-page table that starts on page one will only considered by InDesign scripting as being one character long (and therefore shown as fitting completely in first frame even when it doesn't). The solution for this, as discovered by Dirk, is to test whether the final cell of the table is in an overflow area.
    The solution:
    You cannot just test whether the cell is overflowing, or whether the parent text frame is overflowing, because InDesign will misreport them and their contents when they are in an overflow area, making it impossible to distinguish a cell overflow from a containing-text-frame overflow. So we just check the parent text frame of the final insertion point, which is after the last table, and see if its length is zero (meaning has no visible contents). If so, the insertion point is in an overflow area!
    So the test to run is this:
    var finalCell = myTextFrame.parentStory.tables.lastItem().cells.lastItem();
    if(finalCell.parent.parent.insertionPoints.lastItem().parentTextFrames.length==0) {  ...your code here...  }
    Of course you'll replace myTextFrame with the one you're dealing with in your own script.
    Example usage:
    This is how I implemented this in my own script. I have an array of text frames which I pass to this function, and by the time I call the function this array contains only one element, just the first large text frame (with my long table already placed inside it). It also relies on a helper function drawTableFrame which is simple and I'll leave out; it just adds a text frame to the new page and sizes it. And of course myDocument I've long ago set to be the document I'm working in.
    // Takes array of text frames, checks for overflow, and adds pages as needed
    function addOverflowPages(whichFrameArray) {
        var i = 0;
        var finalCell = whichFrameArray[0].parentStory.tables.lastItem().cells.lastItem();
        while (finalCell.parent.parent.insertionPoints.lastItem().parentTextFrames.length==0) {
            i++;
            var newpage = myDocument.pages.add(); // add new page
            whichFrameArray.push(drawTableFrame(newpage)); // draw new frame
            whichFrameArray[i].previousTextFrame = whichFrameArray[i-1]; // link new frame to previous one
    I hope this one is solid at last. I have tested it with empty final cell, full final cell, partially-overflowing final cell, and totally-overflowing final cell, and they all work for me. Thanks again to everyone for pointing me in the right direction!

  • TableView cellfactory set style based on content from another cell

    I'm trying to figure out how to set the color of the current cell based on the content from another cell or property in the class that contains the row content. I looked at the following thinking I can use this but the table position method is not longer there.
    ((Person) t.getTableView().getItems().get(t.getTablePosition().getRow())).setLastName(t.getNewValue()); // from a oracle tableview javafx example
    I would like to:
    if (((Person) t.getTableView().getItems().get(t.getTablePosition().getRow())).getRowError())
    cell.setStyle("..."); // Set the color of the cell content
    Is there away to get the underlying object from the setcellfactory call method?

    Does
    t.getTableView().getItems().get(getIndex())give you access to the object represented in the current row? The getIndex() method is a TableCell method (inherited from IndexedCell).

  • Related Content on Formula Cells

    I am trying to create a report that has related content. I want to apply the related content to formula cells but that functionality is disabled on the formula cells in FR Studio. Is there a configuration or property that must be changed to get this to work?
    Thanks
    Ronnie

    Which version are you using?
    11.1.2.0 added the functionality to add Related Content links to be created in any part of a report - such as formula and text rows and columns, row and column headers, images, text boxes and even all of the cells in a grid.
    Regards, Iain

  • Can a formula produced Cell identity ever be used to extract the contents of the cell ?

    1)  Does anyone know if the contents of a cell whos address is obtained with    ' ADDRESS(ROW(),3,4) '    can be placed in another cell ?
    I have only been able to use it as a reference such as:-   =IF((ROW()-2)>(ADDRESS(ROW(),3,4)),"Y","N")   This uses the content of column C on the same row as the function, and compares to a row number 2 rows further up;  (ROW()-2)   but you can't seem to obtain or place the content in another cell. like you can with   =C5.
    2)  Does anyone know how to locate the row/cell in a column range, say, D2:D8 that is empty or has a specified value ?
    The idea is to determin    1) if a a row has been added and, because any cells in that row will be empty,   2)  locate the row.
    I realise that both solutions are not necessary for the obove but, they would be useful for other uses if they can be done.

    Hi Skip,
    Ithink you may have hit the nail on the head with "My problem is I am too impatient."
    Earlier you wrote:
    "What I want to do is locate the row, tag it onto the known column ID  "C"  and then copy the content of that cell into another cell. What I can't get the software to do is put the "C" together with a figure derived by formula and then get the software to recognise it as a cell reference."
    And continued:
    "I can copy the content of say  D6 into another cell using =D6.
    "If I put together "D" and a number derived by software to get D6 it will not work even though it looks the same. I can get a lagitimate D6 but I think it is all a string, not a string+ number."
    'I even tried CONCATINATION but it wont  accept a figure. It seem to thwart all attepts. most annoying."
    Badunit replied:
    "=INDIRECT("C5") will give the same answer as =C5"
    To which you replied:
    "Appreciate you taking the time to answer but no, it was the software composed "C5" that was giving the problem. You don't seem to be able to use it if used indirectly. sorry no connection with INDIRECT, intended."
    Breaking that down, using the C5 example:
    You have the text string "C"
    You have, using a formula, determined the row number 5.
    You want to get the content of cell C5
    Use CONCATENATE to build the text string "C5"
    Use that text string "C5" as the argument for INDIRECT
    Your formula will be =INDIRECT(CONCATENATE("C",sum(2,3)))
    with 'sum(2,3)' replaced by the formula you are using to determine the row number needed for the cell reference.
    Example follows.
    Regards,
    Barry

  • How can i get the content of JTextArea with out loosing Indentation.

    I am developing one mail sending application. I am getting mailid , from address, mail body from one Swing. In one JTextArea i am typing i have typed some matter. When i call the content of JTextArea using
    jtx.getText() method, i am getting all the content as one paragraph. That means there is no indentation which was there in TextArea.
    Please provide me some solution how can i get the content of JTextArea wiht out loosing indentation.

    And it was you who asked the question!

  • Get all content from iTouch to a new computer.

    My problem is very simple to explain, but I find no solution.
    My old computer is damaged and I cant use it anymore. So I bought a new one and I want to get all my stuff from the iTouch to iTunes on me new computer. After installing iTunes I actived in iTunes my iTouch for iTunes. In iTunes I get the massage that now two computers are actived (5 are possible).
    So I connect my iTouch with the wire to my computer and I get the massage that my iTouch is logical connected with an other iTunes libary. I get the only possibility to delete my iTouch and syncronize it with the content of the new iTunes libary.
    *My question is how can I get my content from the iPod touch to iTunes on my new computer?*

    Hi,
    Welcome to Apple discussions.
    So, in a perfect world, you would restore your library of valuable music from *your backed up files* to the library on your new PC, you know, the ones burnt to DVD/CD or on an external HD.
    This is the way iTunes works, it makes it perfectly clear and actively encourages users to *back up your music*.
    The iPod touch is not a back up device (nor is it advertised as one) it is a music player with a volatile memory that could actually disappear at anytime so it should not be trusted as a store for valuable files.
    To salvage your music you will have to use some 3rd party application on your PC/Mac (you fail to say) such as [Touch Copy|http://www.wideanglesoftware.com/touchcopy/index.html], Google for other options. This is not guaranteed to work but hopefully you will get your music back.
    Then back up.
    Good luck,
    Dud.
    *iPod touch* by the way, this an [ITOUCH|http://en.pasen.it/product_detail.php?id=36]

  • I could not found all music and videos in my laptop in itunes? how can i get all content to my itunes?

    hi i am using iphone 3gs 32gb. i installed itunes in my laptop but i couldnot found all files like music and videos present in my laptop. can anybody tel how to get all content? thanks you

    The songs that you downloaded on the iPad can be transferred to the computer when you sync with iTunes. For the music from your cousins computer - if they were purchased with his Apple ID - you can't sync them to your iTunes account.

  • My computer crashed and my itunes library only has my purchases which is 645 songs instead none of my play lists.  my 60g ipod has 1145 songs and all my playlists.  how do i get this content back to my itunes program

    my computer crashed and i had to reinstall intunes.  i have 1144 songs plus some playlists on my old 60g ipod.  my itunes library on my computer only has the songs that i purchased from itunes and none of playlists.  how do i get this content form my ipod back onto my itunes program on my computer.

    check out this post by Zevoneer.

  • To get the content of a pdf file in a particular position in text format

    I am troubling with geting the content of a pdf file in a particular position.I got the code to get the content of a pdf document as whole in text format.But i only need the content at a particular area.
    i am using PDFTextStripper class in pdfBox jar to get the content as whole.
    pls send some sample code
    pls help me
    Edited by: thomas00 on Sep 21, 2007 2:55 AM
    Edited by: thomas00 on Sep 21, 2007 3:08 AM

    pls any one reply

  • I am thinking of buying a MacBook Air and am wondering how to get the content of my iPad into iTunes.

    I have iTunes on an old pc and am thinking of buying a MacBook Air. I am wondering how to get the content of my iPad on to the Mac as I know that sync only happens in one direction, from pc to device. I assume therefore that when I attach my pad to the new Mac it will sync to an empty iTunes and I will have lost all the content of my pad. I know I can restore purchases, but what about contacts, calendar, photos and music not purchased from apple. I have a fairly recent backup on a pen drive but it is a usb2 device and is formatted for a pc. Any advice would be appreciated.

    Do I copy my media library or from a backup.  I have a backup on my pc and on an external drive. This drive is usb2 and formatted for windows so I can't connect it to a MacBook Air to make the transfer.  Equally I don't think there is a way to connect the 2 computers via a cable ie usb2 one end and usb3 the other.  Will the computers talk to each other via wifi if I enable home share although I think this is only for music which still leaves contacts, mail etc.
    I am sorry to be such an ignoramus but any further help would be appreciated.

  • My iTunes library is on an old PC that no longer works. I purchased a new iPod Touch.  How can I get the contents of my library to the new iPod?

    My iTunes library is on an old PC that no longer works. I purchased a new iPod Touch.  How can I get the contents of my library to the new iPod?

    My iTunes library is on an old PC that no longer works. I purchased a new iPod Touch.  How can I get the contents of my library to the new iPod?

  • I got some books from the itunes store and put them into my library.  I created a playlist so that I could burn them to cds.  The title is there but no contents.  It won't even play the playlist.  How do I get the contents of the book?

    I got some books from the itunes store and put them into my library.  I created a playlist so that I could burn them to cds.  It won't even play the book, there are no contents.  How do I get the contents of the book?

    I'm guessing this is a problem unique to me as there have been no replies at all...  Thanks a bunch folks

  • How can I get right data in a cell of JTable when table  enter editing

    how can I get right data in a cell of JTable when table enter editing

    how can I get right data in a cell of JTable when table enter editing

  • How to get the content in embed swf file in Swf Loader on run time

    How to get the content in embed swf file in Swf Loader on run time
    [Bindable]
    [Embed(source="assets/index.swf")]
       private var SWFSRC:Class;
    <mx:SWFLoader id="_swfloader" source="{SWFSRC}" />

    Hi Flex harUI,
    Throw the error.
    Access of undefined property content

Maybe you are looking for

  • Rebuilding Site with Modal Windows in Muse

    My portfolio site uses JavaScript to create a modal window with a width based on the size of the visitor's browser window. I'd like to recreate the site with Muse, but I'm not sure how to recreate this function. How do I incorporate the current JavaS

  • A strange error in Safari...

    Hello I wish ask for a little help, I have tried to go to a site where I want to sell my G5. On that site there is this place called Market, and they have all kinds of links to product people sell. I wanted to sell my mac there. But to my amazement I

  • Can't go online with Skype

    I'm on a private Wifi network at my work. I have access to the whole internet, including this page that I'm writing on now. However, starting today, I am unable to go online with Skype. I can login and see which of my contacts are online. But I'm una

  • LoadVars and Acented Characters

    Hi when I try to load a txt file with name/value pairs, The accented charaters do not appear. For example: $Local=José The é character is not loaded properly. What can I do? See attached code

  • Lost podcast feed from mobileme. Help!

    We somehow didn't realize that we had setup our podcast feed years ago on the .mac/mobileme account that just went away. Our podcast no longer shows up in iTunes, can't even search for it. Can't download old episodes from iTunes. Currently moving all