Globally adding content to empty cells in InDesign Tables

I have a file with 190 tables, all with a number of empty cells. The client has decided that these cells need to contain an m-dash. Is there a way to globally add this m-dash to all empty cells, to avoid having to go cell by cell?

I think that would have to be scripted.
Perhaps check out the Scripting forum - but sometimes those clever scripters are lurking here too

Similar Messages

  • On clicking empty cell in the table

    System forces user to enter valid value on clicking empty customised cell in the table. it should not happen eventhough cell is previously empty.

    hi
    Set the table property visibleRowCount property using a context attribute in your code. Set it to the value node (data source) size.
    e.g
    ; wdContext.currentContextElement().set<attributename>(wdContext.node<urnode>().size());
    Hope it helps.
    regards
    LNV

  • Unsplitting cells in InDesign tables

    I want to edit or remove the splits in a cell in a table, i cannot find a way of doing this apart from recreating the row. Does anyone know a better method?

    Maybe it will help if I explain what I'm trying to do. The table is a drugs chart which keeps track of the number of times a day a certain medicine should be taken. Each row represents a different medicine, and the cells the days of the week. Each cell is then split to indicate the number of doses in a day. I am trying to alter the the number of splits in a cell to indicate a different number of doses in a day. So I want to keep the cells separate but alter the number of vertical splits.

  • Adding ToolTip for individual cell in the table

    Hi everybody,
    Its urgent. I want to add ToolTip for individual cells. What I have implemented, it show same ToolTip for each cell. I want different ToolTip for individual cell.
    My cells are not editable, as i need this.
    Pleae help me.
    Thanks in Advance.
    Dawoodzai

    Hi,
    See this demo pasted below-
    import java.awt.*;
    import javax.swing.*;
    public class SimpleTableDemo extends JFrame {
         public SimpleTableDemo() {
              super("SimpleTableDemo");
              Object[][] data = {
                   {"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)},
                   {"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)},
                   {"Kathy", "Walrath", "Chasing toddlers", new Integer(2), new Boolean(false)},
                   {"Sharon", "Zakhour", "Speed reading", new Integer(20), new Boolean(true)},
                   {"Angela", "Lih", "Teaching high school", new Integer(4), new Boolean(false)}
              String[] columnNames = {"First Name", "Last Name", "Sport", "# of Years", "Vegetarian"};
              final JTable table = new MyTable(data, columnNames);
              table.setPreferredScrollableViewportSize(new Dimension(500, 70));
              JScrollPane scrollPane = new JScrollPane(table);
              getContentPane().add(scrollPane, BorderLayout.CENTER);
         public static void main(String[] args) {
              SimpleTableDemo frame = new SimpleTableDemo();
              frame.pack();
              frame.setVisible(true);
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MyTable extends JTable {
         public MyTable(Object[][] rowData, Object[] columnNames) {
              super(rowData,columnNames);
         public String getToolTipText(MouseEvent e) {
              int r = rowAtPoint(e.getPoint());
              int c = columnAtPoint(e.getPoint());
              return getValueAt(r,c).toString();
    }

  • Adding different tooltip for a column in table??

    Hi here,
    I have read the similar title "Adding ToolTip for individual cell in the table".
    The method that use "tableModel" and "override getToolTipText" for individual cell is useful for individual cell with tooltip that i have tried.
    How could i get the tooltip for each columns and show every row value on each tooltip.I wish when mouse moved above a column and the column could show all of that column's row value.
    Please help me.
    Thanks..

    your explanation sounds a bit confusing but if i got you right
    you could do something like this in your table
    public String getToolTipText(MouseEvent me)
          int row = this.rowAtPoint(me.getPoint());
          StringBuffer tooltip = new StringBuffer();
          for(int i=0; i<getColumnCount; i++)
             tooltip.append(getValueAt(row, i).toString());
          return tooltip.toString();
       }

  • How can I add a character globally to empty cells in an InDesign table?

    I have a document with 190 tables, each with many empty cells. Client now wants m-dashes in the empty cells. Is it possible to do this in an automated fashion, without having to go cell-by-cell?

    Hi Jarek,
    Unfortunately I'm still getting the same "no tables found in the active document" message after modifying it the way you instructed.
    Here's my current code. Hopefully you'll be able to detect my problem. I greatly apologize for my ineptitude in javascript
    try 
    var myCells = app.app.selection[0].cells.everyItem().getElements(); 
    alert("myCells:" + myCells.length) 
    for(i=0; i<myCells.length; i++) 
        if(myCells[i].contents == "") 
            myCells[i].contents = "N/A" 
    catch(myError) 
        alert("no tables found in the active document") 

  • InDesign Table - Collapse empty Row

    My apologies if this is not posted in the proper category...
    Ok, here's my issue...
    I have a table with 5 rows.  Sometimes, not all of the rows in the table will contain data.  Is it possible for InDesign to automatically collapse a row if there is no data present in the cells in that row?
    Thanks!

    Jongware has probably answered this already, but if not:
    To run a script in InDesign, copy the code and paste it into
    an ordinary text editor (such as Notepad in Windows), then
    save the file with the extension .jsx in the Scripts Panel Folder
    (typical path: Start > MyComputer > Local Disk(C:) >
    Program Files > Adobe > Adobe InDesign CS3 > Scripts >
    Scripts Panel).
    It will then be available from within InDesign (Window > Automation > Scripts).
    Yesterday's script removes empty rows from all tables in a document.
    You might find the script below a bit more convenient, as it removes
    empty rows in selected tables (or tables in selected text) only.
    To run the script, highlight a table or some text containing a
    number of tables, and then double-click on the name of the script in
    the Scripts panel.
    var mySelection=app.activeDocument.selection[0];
    try{ var myTableCount = mySelection.tables.length;}
    catch(myError){ var myTableCount = 1;}
    for (var i=myTableCount-1; i >=0; i--) {
    try{ var myTable = mySelection.tables.item(i);}
    catch(myError){var myTable = mySelection; }
    for(var j=myTable.rows.length-1; j>=0; j--){
                var myContents = 0;
                for(var k=myTable.rows[j].cells.length-1; k>=0; k--){
                    if (myTable.rows[j].cells[k].contents != "") myContents++;
                if (myContents == 0) myTable.rows[j].remove();

  • 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

  • In InDesign, how can I name individual cells in a table for interactive PDFs?

    Hi, I'm creating interactive PDFs for a client that include tables with empty cells that will be populated afterwards (depending on what information a customer puts in on a form).
    The forms are created in InDesign and exported as interactive PDFs, but I need to be able to name the live fields (in InDesign) before I export the Interactive PDF, so that I don't have to select each indivual field in the final PDF and rename them.
    The reason I want to be able to do this pre-PDF production, is because the forms will be rebranded over and over again and I don't want to have to rename hundreds of cells time and time again in Acrobat Pro.
    The deveopler who's populating the cells already has predefined names for them, so I can's simply give him the names that Acrobat automatically defines.

    What version of InDesign are you using? If CS6 or CC, you can add fields and enter a name for each in the Name field of the Buttons and Forms panel.

  • [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

  • Cannot Autofill sequential content into adjacent cells in Numbers

    Numbers V3.2 for OSX
    Problem #1:
    I cannot Autofill sequential content into adjacent cells.  I enter Jan., Feb. into the first two cells, then try to use the little yellow ball to project Mar., Apr., etc. into the adjacent cells.  I'm new to Numbers, so maybe I'm missing something.  I've used Excel for over 25 years, and I'm now trying to convert to Numbers.
    Problem #2:
    How do you link a cell from one spreedsheet to a second spreedsheet?  I read all of the Help files and can't find a reference.
    Thanks for your help!

    HI Paul,
    "I found that one of my problems is that I abbreviated the month, i.e., Jan."
    If you include a period after Jan, Numbers will not recognize it as a shortened month name. use "Jan" (without the quotes).
    Regarding linking cells:
    If by "spreadsheets" you mean "Tables in the same document," cells in those two locations can be linked. In the simplest case (two tables on th same Sheet, or two tables, each with a name unique within the document, on separate Sheets, the Table name must be added to the cell reference.
    Example: formula in a cell on table named "This" referencing cell B2 on a table named "That" located elsewhere in the same document:
    =That::B2
    If the second table is in a different document, no. Numbers cannot reference external documents.
    If this is a significant issue, Provide Numbers Feedback, using the item of that name in the Numbers menu, to make a feature request for a future version of Numbers.
    Regards,
    Barry

  • How to shift content with in cell in xml rules table

    Hi all scripters,
    I've created a table using xml rules with 3 nos of cells where first cell contain some data and so on but in next row first cell may of may not contain any data so in that row second cell data shifted to first cell and thired row data shifted to second cell which is very anxious for me since second cell data in each row should be in second cell only.
    For Instance-: Required output
    Title
    PageNo
    Subject
    Title
    46
    The Subject
    50
    Another Subject
    54
    Subject
    Title
    60
    Another Subject
    64
    The subject
    The out put I am getting by script-:
    Title
    PageNo
    Subject
    Title
    46
    The Subject
    50
    Another Subject
    54
    Subject
    Title
    60
    Another Subject
    64
    The subject
    myRuleSet = new Array ( new ProcessSec,
               new ProcessPara,
               new ProcessSecHead,
               new ProcessArt,
               new ProcessPG,
    with(myDocument){
        var elements = xmlElements;
         __processRuleSet(elements.item(0), myRuleSet);
    function ProcessSecHead(myXPath){
        this.name = "ProcessSecHead";
        this.xpath = myXPath;
        this.apply = function(myElement, myRuleProcessor){
       with(myElement){
                __skipChildren(myRuleProcessor);
                  var myNewElement = myContainerElement.xmlElements.item(-1).xmlElements.add(app.documents.item(0).xmlTags.item("Cell"));
         myElement.move(LocationOptions.atBeginning, myContainerElement.xmlElements.item(-1).xmlElements.item(-1));
        return true;
    function ProcessPara(){
        this.name = "ProcessPara";
        this.xpath = "//para";
        this.apply = function(myElement, myRuleProcessor){
                var myNewElement = myContainerElement.xmlElements.add(app.documents.item(0).xmlTags.item("Row"));
            return true;
    function ProcessArt(){
        this.name = "ProcessArt";
        this.xpath = "//para/aug";
        this.apply = function(myElement, myRuleProcessor){
            with(myElement){
                __processChildren(myRuleProcessor);
                var myNewElement = myContainerElement.xmlElements.item(-1).xmlElements.add(app.documents.item(0).xmlTags.item("Cell"));
                myElement.move(LocationOptions.atBeginning, myNewElement);  
            return true;
    function ProcessPG(myXPath){
        this.name = "ProcessPG";
        this.xpath = myXPath;
        this.apply = function(myElement, myRuleProcessor){
            with(myElement){
                __skipChildren(myRuleProcessor);
                var myNewElement = myContainerElement.xmlElements.item(-1).xmlElements.add(app.documents.item(0).xmlTags.item("Cell"));
                myElement.move(LocationOptions.atBeginning, myNewElement);
            return true;
    Any would be greatly appreciated
    Mac

    Wow, sorry for the delay.
    This paradigm is difficult enough to deal with, but Adobe's example code really does not encourage you to handle this reasonably at all.
    I've basically rewritten the entire process, and I've introduced a new paradigm for creating rules that I think is a lot more readable and flexible and allows for parametrization. Anyhow, here you go. Any questions?
    /*jslint undef: true, newcap: true, nomen: false, regexp: true,
            bitwise: true, onevar: true, indent: 4, white: false */
    /*global File, LocationOptions, PageSideOptions,
      UserInteractionLevels,
      __processChildren, __processRuleSet, alert, app */
    #include "glue code.jsx";
    // handy debugging function; e.g.: $.writeln(dumplist(x.xmlElements));
    function dumplist(l) {
        var i, rv = [];
        rv.push("has "+l.length+" elements:");
        for (i=0; i<l.length; i++) {
            rv.push("  "+i+"\t"+l[i].toSpecifier()+
                        "\t"+l[i].markupTag.name);
        return rv.join("\n");
    // Initialize a tags object to map strings to tags.
    function initTags(doc, tagnames) {
        var i, t, tags = {};
        for (i=0; i<tagnames.length; i++) {
            try {
                t = doc.xmlTags.add(tagnames[i]);
            } catch (e0) {}
            tags[tagnames[i]] = doc.xmlTags.itemByName(tagnames[i]);
         return tags;
    // Handy subtree functions
    function firstChildTag(node, tag) {
        var i, e = node.xmlElements;
        for (i=0; i<e.length; i++) {
            if (e[i].markupTag === tag) {
                return e[i];
        return node;
    function lastChildTag(node, tag) {
        var i, e = node.xmlElements;
        for (i=e.length-1; i>=0; i--) {
            if (e[i].markupTag === tag) {
                return e[i];
        return node;
    //// XML rule functions
    // Adobe's sample for how to define these is HORRIBLE.
    // Let's fix several of these problems.
    // First, a handy object to make clearer the return values
    // of XML rules:
    var XMLmm = { stopProcessing: true, continueProcessing: false};
    // Adobe suggest defining rules constructors like this:
    //   function RuleName() {
    //       this.name = "RuleNameAsString";
    //       this.xpath = "ValidXPathSpecifier";
    //       this.apply = function (element, ruleSet, ruleProcessor){
    //       //Do something here.
    //       //Return true to stop further processing of the XML element
    //       return true;
    //       }; // end of Apply function
    // And then creating a ruleset like this:
    //   var myRuleSet = new Array (new RuleName, new anotherRuleName);
    // That syntax is ugly and, and is especially bad if
    // you need to parametrize the rule parameters, which is the only
    // reasonable approach to writing reasonable rules. Such as:
    //   function addNode(xpath, parent, tag) {
    //       this.name = "addNode";
    //       this.xpath = xpath;
    //       this.apply = function (element, ruleProcessor) {
    //           parent.xmlElements.add(tag);
    //           return XMLmm.stopProcessing;
    // and then creating a ruleset like:
    //   rule = new Array (new addNode("//p", someTag));
    // So instead we introduce a makeRule function, that
    // allows us to leave behind all the crud. So then we can write:
    // addNode = makeRule("addNode",
    // function(element, ruleProcessor, parent, tag) {
    //     parent.xmlElements.add(tag);
    //     return XMLmm.stopProcessing;
    // and use:
    // rule = [ addNode("//p", someTag ];
    function makeRule(name, f) {
        return function(xpath) {
            var
                //xpath=arguments[0],
                   // "arguments" isn't a real array, but we can use
                   // Array.prototype.slice on it instead...
                   args=Array.prototype.slice.apply(arguments, [1]);
            return {
                name: name,
                xpath: xpath,
                apply: function(element, ruleProcessor) {
                        // Slice is necessary to make a copy so we don't
                        // affect future calls.
                    var moreargs = args.slice(0);
                    moreargs.splice(0, 0, element, ruleProcessor);
                    return f.apply(f,moreargs);
    // Create a new node at parent. Doesn't do
    // anything with the XPath context node.
    var addNode = makeRule("addNode",
    function(element, ruleProcessor, parent, tag) {
        parent.xmlElements.add(tag);
        return XMLmm.stopProcessing;
    // Create a cell for a table, adding a node to
    // the last node of the last node of the
    // table. Duplicate the context
    // node as a child of that cell.
    var makeCell = makeRule("makeCell",
    function(element, rp, table, outertag, innertag) {
        var
            cell = table.xmlElements[-1].xmlElements.add(outertag),
            copy = element.duplicate();          
        copy.markupTag = innertag;
        copy.move(LocationOptions.AT_BEGINNING, cell);
        return XMLmm.stopProcessing;
    // Apply from() to the context node to get
    // a source node. Copy that source node
    // to be the first child of the context node.
    var copyFromToChild = makeRule("copyFromToChild",
    function(element, ruleProcessor, from) {
        var copy = from(element).duplicate();       
        copy.move(LocationOptions.BEFORE,
          element.xmlElements[0]);   
        // __skipChildren(ruleProcessor);
        return XMLmm.continueProcessing;
    // We don't actually use this, but it was useful
    // in debugging. Essentially "rename" a node.
    // Set the tag of the context node to the
    // specified tag.
    var setTag = makeRule("setTag",
    function(element, ruleProcessor, newtag) {
        element.markupTag = newtag;
        return XMLmm.stopProcessing;
    // Apply from() to the context node to get
    // a source node. Apply to() to the
    // context node to get a destination node.
    // Move the source node in the specified
    // location (how) to the destination node.
    var moveFromTo = makeRule("moveFromTo",
    function (element, ruleProcessor, from, how, to) {
        __processChildren(ruleProcessor);
        var src = from(element);
        src.move(how, to(element));
        return XMLmm.continueProcessing;
    // end rule functions
    // It's just not worth rewriting some of Adobe's ugly functions...
    // but at least fix it up so it JSLints.
    function myGetBounds(myDocument, myPage){
        var
            myPageWidth = myDocument.documentPreferences.pageWidth,
            myPageHeight = myDocument.documentPreferences.pageHeight,
            myX1, myX2, myY1, myY2;
        if(myPage.side === PageSideOptions.leftHand){
            myX2 = myPage.marginPreferences.left;
            myX1 = myPage.marginPreferences.right;
        else{
            myX1 = myPage.marginPreferences.left;
            myX2 = myPage.marginPreferences.right;
        myY1 = myPage.marginPreferences.top;
        myX2 = myPageWidth - myX2;
        myY2 = myPageHeight - myPage.marginPreferences.bottom;
        return [myY1, myX1, myY2, myX2];
    function myGetScriptPath() {
        try {
            return app.activeScript;
        catch(myError){
            return new File(myError.fileName);
    // OK, the actual program.
    function main() {
        var
            doc = app.activeDocument,
            page = doc.pages[0],
            root = doc.xmlElements[0],
            //inputFile = new File(myGetScriptPath().path+ "/mac.xml"),
            inputFile = File.openDialog(),
            tags = {},
            p, table;
        if (app.documents.length<1) {
           alert ("Open a document and run the Script");
           return false;
         // Let's not use a seperate variable for each tag. Instead,
         // we'll keep an Object that maps strings to tags.
        tags = initTags(doc,
                             ["table", "para", "article",
                              "section", "section-head", "tr", "td", "p"]);
        doc.xmlImportPreferences.allowTransform = false;
        doc.xmlImportPreferences.ignoreWhitespace = true;
        app.scriptPreferences.userInteractionLevel =
              UserInteractionLevels.NEVER_INTERACT;
        doc.importXML(inputFile);
        app.scriptPreferences.userInteractionLevel =
              UserInteractionLevels.INTERACT_WITH_ALL;
        // For each <para>, copy the parent's <section-head> inside.
        // Next, move each <article> node to the end of the <para>,
        // placing it after the <page> node.
        __processRuleSet(root, [
            copyFromToChild(
                "//para",
                function(n) {
                        return firstChildTag(n.parent,tags["section-head"]);
            moveFromTo(
                "//para",
                function(n) { return firstChildTag(n, tags.article); },
                LocationOptions.AT_END,
                // This is more general than we need to be; we're moving
                // to "the end", but the end of WHAT? It need not be the
                // <para>, it could be some other node.
                function(n) { return n; })
        // Add a <p> node to hold the table we're about to create.  It's
         // not super-clear from the documentation, but
         // convertElementToTable creates a text node of the table in the
         // XLM structure. In order to then place that into a frame, there
         // has to be an enclosing XML node to do so. We choose <p> for
         // lack of a better tag.
        p = root.xmlElements.add(tags.p);
        table = p.xmlElements.add(tags.table);
        // For each para node, add a <tr> to the table.  For each
        // <section-head>, <page>, or <article>, add a <td> to the last
        // <tr> of the table
        __processRuleSet(root, [
            addNode("//para", table, tags.tr),
            makeCell("//para/section-head", table, tags.td, tags.p),
            makeCell("//para/page", table, tags.td, tags.p),
            makeCell("//para/article", table, tags.td, tags.p)
         // Make it a table and GO!
        table.convertElementToTable(tags.tr, tags.td);
        p.placeIntoFrame(page, myGetBounds(doc, page));
    main();
    I also tried to format this to 72 columns so that it doesn't scroll on the forums. Let's see if that works...Nope, not quite. Oh well. Close enough.

  • How to change content of DataGrid cell on mouse over

    I am trying to change content of a datagrid cell when the mouse is over it. Changing the dataProvider does not provide immediate feedback because update is performed by renderer. I am trying to directly update content of a cell onMouseOver and restore it onMouseOut.
    I am thinking of leaving the column empty and insert content onMouseOver, cleanup onMouseOut. Alternative, may be I can populate the column and mask out all but the cell the mouse is over.
    Any suggestion on how this may be done?
    Thanks!

    I would override updateDisplayList, call isItemHighlighted and set the content of the cell accordingly
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Zero or Empty cells in Pie-Charts (HELP!)

    I need to make a pie-chart that shows the names of the labels - unfortunatly there are some cells that have no values (?)
    But whenever i want the labels to showup in the pie-chart, all 'empty' or '0' cells clutter up the pie-chart, filling it up with zero's and several layerd labels on top of each.
    i know, i can hand-select those rows that do have non-zero values - but that is 'hand-work' and that is not what we are up to at all.
    i tried to trick with filtering out the rows, but it does not affect the chart
    i tried to delete the contents of the cells, but still, because it has a label in the left column, it shows up
    i tried to fool Numbers by producing an ERROR() in the calculation
    but nothing seems to get rid of the 0% in the pie-chart
    please help, i'm running out of time

    Hello
    What I describes here
    http://discussions.apple.com/thread.jspa?threadID=1202856&tstart=0
    for a line chart apply to 3D pie charts too.
    Yvan KOENIG (from FRANCE lundi 29 octobre 2007 14:39:33)

  • How to resolve merge empty cells JS error

    Hi Scripters
    I am new to scripting and now looking into it.
    I am trying to write a table script for that, I found one merge empty cells JS from Jongware GfBROo
    table = app.selection[0];
    if (!(table instanceof Table)) table = table.parent;
    if (table instanceof Cell) table = table.parent;
    if (table instanceof Table)
         for (r=0; r<table.rows.length; r++)
              c = 0;
              while (c < table.rows[r].cells.length)
                   while (c < table.rows[r].cells.length &&
                        table.rows[r].cells[c].contents.length > 0)
                        c++;
                   while (c < table.rows[r].cells.length &&
                        table.rows[r].cells[c].contents.length == 0)
                        table.rows[r].cells[c].merge (table.rows[r].cells[c-1]);
    Even though for almost tables it's working like charm but in some of the cases it's falling me in trouble by showing this error "Object is Invalid" at bold face line.
    Though I can guess some problem wolud be with those tables but I am not able to catch it.
    Could any one any way suggest me to resolve this error.

    Thanks for reply Loic_aigon
    As Marc suggested in discussion, I used
    myTable.rows[r].cells[c].characters.everyItem().contents.length > 0
    But above syntex falls script to infinite loop.
    any other help will be appreciated.

Maybe you are looking for

  • Problem in Showing multiple values into one text box.

    Hi all, How can show i multiple row values into one text box. here text box is multi line type. i have one table it has content column, it has number of rows. i need to show those data into one text box in form. how can i solve it? my sample code her

  • Use variable for filename for exportdata

    I am trying to set a var value and then use the var in the exportdata method using formcalc. var txtFileName = "DataFileName" if (tbxVicName.isNull) then var txtFileName = Concat(num2date(date(), "YYYY_MMM_DD"),"_CameronDamageAssesment") xfa.host.exp

  • PB Camera's not Working : (

    The front camera went out, I switched to the rear camera took one pic and then it went black as did the front one. I still have the camera moce tool bar choices, zoom, movie/camera etc. just no picture on screen. Other that replacing the camera any t

  • Closure of WBS Element - If no costs existing.

    Hi,  one of the WBS element having no costs but auc created through Investment measure.  But while closing the WBS element system throwing error as follows" Go to the asset in construction for the WBS element and correct the error that appears there"

  • Need to test if a column have unique values or not

    Hi all, in ETL process I need to check if some cols have unique values or not using sql or plsql. Suppose we need to load a big file data with external table initially and then test if values on one or more columns have unique values  in order to pro