[CS3 JS]Get all the tables in the document

Hello All,
I want to return all of the tables in the document, including those in table cells. I am using this:
var aTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();
but it doesn't get tables inside of tables. Is there an easy way to do this without checking each table cell? Thanks in advance.
Rick Quatro
585-659-8267

Hi Robin and Dave,
Thanks for your replies. This seems to work fine regardless of the nexting level.
Rick
var oDocTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();
if (oDocTables.length)
  oDocTables = GetAllTables(oDocTables);
alert(oDocTables.length);
function GetAllTables(oTables)
  for(var i=0; i < oTables.length; i++)
    var oCells = oTables[i].cells;
    for (var j=0; j < oCells.length; j++)
      var oCellTables = oCells[j].tables.everyItem().getElements();
      if (oCellTables.length)
        oTables = oTables.concat(oCellTables);
  return oTables;

Similar Messages

  • Cannot display all the tables of the schema!!!

    Hi:
    I use the oracle sql developer on the windows xp, I found that the tables tab cannot display all the tables of the schema owner, I use the sql "select count(*) from user_tables" I found the result is more than the tab can be display, and I also press the "show more" already.... does anyone can help me ???

    Similarly, I have 852 tables owned by the connected user (selected count from user_tables and checked the user tables report which has this many records returned), but when I double-click on the "Show More" and select Show All, I only get approximately 375 tables listed.
    It doesn't help that the sorting is different - ie ASF_ comes before ASFB in the connection pane but the other way around in the report.
    However, it looks as though the problem is that tables that are not analysed (based on the report data in DATE_LAST_ANALYZED) are not being displayed under the Table node.

  • I had my ipod synced to an old computer that I no longer have how can i get all my stuff on the new itunes without erasing it

    I had my ipod synced to an old computer that I no longer have how can i get all my stuff on the new itunes without erasing it

    Most Windows users don't.
    Purchase an external hard drive and use the backup software that comes with it to backup files from your computer.
    Buy TouchCopy and install it on your new computer, connect your old iPod and transfer your songs to your computer.

  • Getting an "unable to Load the tables in the power pivot window" error

    Hello,
    I have 2 worksheets in a excel file and would like to load both into a power pivot table. When I click the 'create linked table' in the pwer pivot ribbon, The powerpivot window open and looks like its about to load the data but then I get
    a popup dialogue box with the following error:
    Unable to load the tables in the powerpivot window 
    ============================
    Error Message:
    ============================
    The given key was not present in the dictionary.
    ============================
    Call Stack:
    ============================
       at System.ThrowHelper.ThrowKeyNotFoundException()
       at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
       at Microsoft.AnalysisServices.Modeler.SheetTabs.PopulateSheetList(String selKey)
       at Microsoft.AnalysisServices.Modeler.SheetTabs.SetSelectedSheet(String key)
       at Microsoft.AnalysisServices.Modeler.ClientWindow.RefreshClientWindow(String tableName)
    ============================
    When I try again, there is a meesage saying the table is already linked but I dont see any data.
    has Anyone seen this error before and know what to do?
    Thanks,
    Nathan

    Hi
    I get first the same error as above but after I look into the details I see the following error message:
    in translation the error message is: There is already a item with the same key added.
    I can open the power pivot window in diagram view. And after I refresh the data in one of the tables I can open it in the table view. I have already searched for "!" signs in the calculations and searched for calculations with same name but that
    is not the problem.
    Also I can't open the synonym window. I think this has something to do with it because I've made changes in the synonyms.
    ============================
    Foutbericht:
    ============================
    Er is al een item met dezelfde sleutel toegevoegd.
    ============================
    Aanroepstack:
    ============================
       bij System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       bij Microsoft.AnalysisServices.Common.LinguisticModeling.SynonymModel.AddSynonymCollection(Tuple`2 measure, SynonymCollection synonyms)
       bij Microsoft.AnalysisServices.Common.LinguisticModeling.LinguisticSchemaLoader.DeserializeSynonymModelFromSchema()
       bij Microsoft.AnalysisServices.Common.SandboxEditor.LoadLinguisticDesignerState()
       bij Microsoft.AnalysisServices.Common.SandboxEditor.set_Sandbox(DataModelingSandbox value)
       bij Microsoft.AnalysisServices.XLHost.Modeler.ClientWindow.RefreshClientWindow(String tableName)
    ============================
    Thanks,
    Leo

  • How to get the column names of the table into the Dashboard prompt

    how to get the column names of the table into the Dashboard prompt
    Thanks & Regards
    Kishore P

    Hey john,
    My requirement is as follows
    I have created a Rank for Total sales by Region wise i.e RANK(SUM(Dollars By Region)) in a pivot table.
    My pivot table looks like this
    COLUMN SELECTOR: TOTAL US , REGION , DISTRICT , MARKET
    ---------------------------------------------------- JAN 2009          FEB 2009        MAR 2009
    RANK              REGION                  DOLLARS           DOLLARS        DOLLARS DOLLARS
    1 CENTRAL 10 20 30 40
    2 SOUTHERN 10 30 30 70
    3 EASTERN 20 20 20 60
    4 WESTERN 10 20 30 40
    When i select the District in column selector
    Report has to display rank based on Total Sales by District. i.e
    ------------------------------------------------- JAN 2009         FEB 2009       MAR 2009
    RANK             DISTRICT              DOLLARS           DOLLARS        DOLLARS DOLLARS
    for this i need to change the fx of rank i.e RANK(SUM(Dollars By Region)) to RANK(SUM(Dollars By District)) and fx of Region i.e Markets.Region to Markets.District dynamically.
    so , i need to capture column name of the value selected from the column selector and dynamically i need to update the fx 0f RANK & fx of region.
    do you have any solution for this?
    http://rapidshare.com/files/402337112/Presentation1.jpg.html
    Thanks & Regards
    Edited by: Kishore P on Jun 24, 2010 7:24 PM
    Edited by: Kishore P on Jun 24, 2010 7:28 PM

  • When I left my former employer, Pollinate Agency, I bought a MacBook Pro with Acrobat Pro (version 9 or possibly 9.5) installed from the company. I recently had a serious computer crash, and needed to get all contents erased. The support provider didn't h

    When I left my former employer, Pollinate Agency, I bought a MacBook Pro with Acrobat Pro (version 9 or possibly 9.5) installed from the company. I recently had a serious computer crash, and needed to get all contents erased. The support provider didn't have my product key, so could not reinstall Acrobat Pro for me. Since then, I have gotten the product key sent to me from my former employer, [ REMOVED ] So I need help in re-downloading, installing and activating the Acrobat Pro software on this computer.

    Please remove the S/N immediately (I can't or would). Never post them online. As for download you can go to http://helpx.adobe.com/acrobat/kb/acrobat-downloads.html on the right panel to get 9 pro. I am not sure there is a MAC version there, but that is the first place to go. If it is the proper version, then please back it up to CD and/or portable HD, not the system HD.

  • To find particular value in all the tables in the db

    Hi All
    I need to find out all the tables, corresponding column name by querying a particular string that appears in any of the columns in the any of the tables in the db.
    Please help me of this.
    Thanks

    Oh dear you want to look for a particular data in all the tables in the database and say this data is available in these tables in these columns. Oh boy thats going to cost you a lot. why do you want to do that. can you share with us why you want to do that.
    Thanks,
    Karthick.

  • I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadshee​t. Any ideas?

    I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadsheet. Any ideas? Right now my data will collect one reading instead of continuously reading my IMU which displays data in a continuous stream.
    Thanks
    Attachments:
    Read_IMU_Drew.vi ‏21 KB

    Hi
    Your vi is in 2009 version, which i am unable to open in 8.6
    However, if you want your data to be saved in excel sheet, here is the VI
    Somil Gautam
    Think Weird
    Attachments:
    save to excel.vi ‏12 KB

  • How get highly active TABLES in the database ?

    Oracle 11g R2 standard edition database.
    1) Is there a way to find which table in the entire database (or) schema is HIGHLY ACTIVE ?
    Highly Active in the sense which has gone through lots of SELECT,UPDATE,DELETE,INSERT
    2) Is there a way to find as how many DML's happened on table SCOTT.EMP from time A to time B ?
    INSERT,DELETE,UPDATE
    If YES please give all the steps
    Thanks in advance.

    johnpau2013 wrote:
    Oracle 11g R2 standard edition database.
    1) Is there a way to find which table in the entire database (or) schema is HIGHLY ACTIVE ?
    Highly Active in the sense which has gone through lots of SELECT,UPDATE,DELETE,INSERT I would suggest looking at the view v$segment_Statistics .
    2) Is there a way to find as how many DML's happened on table SCOTT.EMP from time A to time B ?
    INSERT,DELETE,UPDATE
    If YES please give all the stepsLook for auditing and how it is set for the tables in the documentation for your version . The doc site is http://tahiti.oracle.com .
    Aman....

  • Get All instance names in the stage

    hi,
    is there any way to get all instance name of the objects presents on the stage ? trace them for example
    thank you

    thank you, it's the correct answer but i still can't solve my problem ,
    the thing is that am using a code from http://www.freeactionscript.com that make enemie follow the player, but i need to do some modification, i need to detect collision between enemies so they will not get the one into the other and the thing that i cannot found their instance name, even when i used your function i only get "player_mc : _level0.player_mc" at the output,
    here is the code, i will be really greatful if you can find a way to help me solve this problem .
    ps :
    am trying to write my own code that make enemie follow the player, coz this one looks very complicated
    thank you
    the code :
    * Game Enemy AI Behavior - Run Away & Follow Player
    * Version:           1.0
    * Author:           Philip Radvan
    * URL:                     http://www.freeactionscript.com
    var enemiesArray:Array = new Array();
    var radians:Number = 180/Math.PI;
    createEnemies(5, "typeA", "e1");
    createEnemies(5, "typeB", "e2");
    createEnemies(5, "typeC", "e3");
    // createEnemies(number of enemies, behavior)
    // use ex: createEnemies(10, "slow", "myLinkedMovieClip);
    function createEnemies(enemyAmount:Number, enemyBehavior:String, enemyLibraryClip:String):Void
              //run a for loop based on the amount of enemies
              for(var i = 0; i < enemyAmount; i++)
                        //set temporary variable that will hold the new enemy attributes
                        var tempEnemy:MovieClip = _root.attachMovie(enemyLibraryClip, "enemy"+_root.getNextHighestDepth(),_root.getNextHighestDepth())
                        //give new enemy a random x/y position based on stage width/height
                        tempEnemy._x = random(Stage.width);
                        tempEnemy._y = random(Stage.height);
                        tempEnemy._rotation = random(360);
                        //set enemy behavior
                        if(enemyBehavior == "typeA")
                                  //define enemy characteristics
                                  tempEnemy.speed = 1
                                  tempEnemy.turnRate = .05
                                  tempEnemy.agroRange = 200;
                                  tempEnemy.mode = "follow"
                        else if(enemyBehavior == "typeB")
                                  //define enemy characteristics
                                  tempEnemy.speed = 4
                                  tempEnemy.turnRate = .5
                                  tempEnemy.agroRange = 200;
                                  tempEnemy.mode = "follow"
                        else if(enemyBehavior == "typeC")
                                  //define enemy characteristics
                                  tempEnemy.speed = 1
                                  tempEnemy.turnRate = .2
                                  tempEnemy.agroRange = 100;
                                  tempEnemy.mode = "run"
                        //define variables that are used to calculate following
                        //*don't change these*
                        tempEnemy.distanceX = 0;
                        tempEnemy.distanceY = 0;
                        tempEnemy.distanceTotal = 0;
                        tempEnemy.moveDistanceX = 0;
                        tempEnemy.moveDistanceY = 0;
                        tempEnemy.moveX = 0;
                        tempEnemy.moveY = 0;
                        tempEnemy.totalmove = 0;
                        //add new enemy to array
                        enemiesArray.push(tempEnemy)
    //Update enemies function
    function updateEnemies():Void {
              //run a for loop based on the amount of enemies
              for(var i = 0; i < enemiesArray.length; i++)
                        //set temporary variable that will hold the new enemy attributes
                        var tempEnemy:MovieClip = enemiesArray[i];
                        //run follow function with temporary enemy as the follower
                        updatePosition(tempEnemy, player_mc);
    // updatePosition(follower, target)
    // use ex: updatePosition(myEnemyMovieClip, playerMovieClip)
    function updatePosition(follower:MovieClip, target:MovieClip) {
              //calculate distance between follower and target
              follower.distanceX = target._x-follower._x;
              follower.distanceY = target._y-follower._y;
              //get total distance as one number
              follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
              //check if target is within agro range
              if(follower.distanceTotal <= follower.agroRange){
                        //calculate how much to move
                        follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal;
                        follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal;
                        //increase current speed
                        follower.moveX += follower.moveDistanceX;
                        follower.moveY += follower.moveDistanceY;
                        //get total move distance
                        follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
                        //apply easing
                        follower.moveX = follower.speed * follower.moveX / follower.totalmove;
                        follower.moveY = follower.speed * follower.moveY / follower.totalmove;
                        //move & rotate follower
                        if(follower.mode == "follow")
                                  follower._x += follower.moveX;
                                  follower._y += follower.moveY;
                                  follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians;
                        else if(follower.mode == "run")
                                  follower._x -= follower.moveX;
                                  follower._y -= follower.moveY;
                                  follower._rotation = (Math.atan2(follower.moveY, follower.moveX) * radians)+180;
    //onEnterFrame that executes the updatePosition updateEnemies every frame
    _root.onEnterFrame = function(){
              updateEnemies();
    //start/stop drag for player_mc
    player_mc.onPress = function(){
              startDrag(this);
    player_mc.onRelease = function(){
              stopDrag();

  • TS1559 i have problem with my iphone as it is disable and need to get all my data as the phone needs at least 40 years to enable accessing it

    I have problem with my iphone as it is disable and need to get all my data as the phone needs at least 40 years to enable accessing it

    If you have never connected the phone to iTunes and backed it up or used iCloud to backup your data, it is lost at this point.
    The only way to get back into the phone is to restore it.
    ~Lyssa

  • Why can't I get all my contacts onto the iCloud?

    Why can't I get all my contacts onto the iCloud?

    What I used to copy my contacts from my 1st gen iPod touch to my new 5th gen iPod touch was a piece of software called Syncios.  Just download and install Syncios (www.syncios.com), which is totally 100% FREE.  When you connect your iPad to your computer via the included cable it'll give you a Warning about you can't have iTunes running.  On the Syncios website it'll give you all of the info on how to back up your contacts.  When you connect your 5th gen iPod touch to your computer just click on the Recover button then the file name of the contact back up.  Hope this helps you and it helped me a lot.  I backed up both my contacts and notes using the same software.

  • How to get all video clips to the organize at the same time

    Hi,
    I am a new user and I wonder how to get all video clips to the organize via Get Media or ?? at the same time. Now I have got it one after another and it is very slow.

    My meaning is  to get the clips from hard disk folder. No one after another but all the same time.

  • I have 2 iPads. One gets all books purchased. The other only gets books purchased through it.

    I have 2 iPads. One gets all books purchased. The other only gets books purchased through it.

    On the iPad that only get books purchased on it, do this:
    Settings > iTunes & App Stores > Books = "On"  [Automatic download]
    Also make sure your Apple ID is set correctly and logged on at the top of Settings > iTunes & App Stores

  • Unable to load the tables in the Power Pivot Window – An Item with the Same Key has already been added

    Hi there,
    I recently had the following situation, where I changed the source of my CSV file in Power Query.
    Once I had reloaded the file, it would then not load into Power Pivot. So I disabled the loading from Power Query into Power Pivot. I then enabled the loading to the Data Model. Which then successfully loaded the data into Power Pivot.
    But once I went into Power Pivot, had a look, then saved the Excel file. Once saved I closed the Excel file. I then opened the Excel file again and all the sheets that interact with the Power Pivot data work fine.
    But if I go and open Power Pivot I get the following error: Unable to load the tables in the Power Pivot Window – An Item with the Same Key has already been added.
    This is what I get from the Call Stack
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at Microsoft.AnalysisServices.Common.LinguisticModeling.SynonymModel.AddSynonymCollection(DataModelingColumn column, SynonymCollection synonyms)
       at Microsoft.AnalysisServices.Common.LinguisticModeling.LinguisticSchemaLoader.DeserializeSynonymModelFromSchema()
       at Microsoft.AnalysisServices.Common.SandboxEditor.LoadLinguisticDesignerState()
       at Microsoft.AnalysisServices.Common.SandboxEditor.set_Sandbox(DataModelingSandbox value)
       at Microsoft.AnalysisServices.XLHost.Modeler.ClientWindow.RefreshClientWindow(String tableName)
    I would assume that the issue is with the synonyms and for some reason, when I disabled the loading of my data into the Power Pivot Model, it did not remove the associations to the actual table and synonyms.
    If I renamed the table in Power Pivot it all works fine. So that was my work around. Fortunately I did have a copy of the Excel workbook before I made this change. So I could then go and add back in all the relevant data to my table.
    Has anyone had this before and know how to fix it?
    http://www.bidn.com/blogs/guavaq

    Hi there
    I can share the work book, if possible to send me an email address. As the workbook size is about 9Mb.
    Thanks
    Gilbert
    http://www.bidn.com/blogs/guavaq

Maybe you are looking for