This content has been marked as final. Show 5 replies
A table is part of a collection of 'Tables', not items inside a paragraph.
>myTable = MyFrame.textframes.item(0).tables.item(0)
You don't have to 'item' everything,
should work as well. Also notice the difference between  and (0).  is the first item in an array (not !), as in tables -- since 'tables' is an array. item, on the other hand, is a function, and its argument should therefore be inbetween parentheses.
If we're talking CS3 or CS4, that looks for the first table inside the first anchored text frame of myFrame. Is that's what's needed?
What exactly is selected after the paste? Why are you doing the paste after starting the script?
i work in CS3
what i do:
1. Copy range of cell from Excell sheet
2. Paste in new page in pub in any plase
3. Place text cursor into got table and format table with specifying params
4. Enlarge frame up to Table boundaries (this is big enough, much more than page boundaries)
5. last - rotate on 90 degree and ajust this big frame to page boundaries.
All these items (but #3) i could automate.
Now i need just to change selection from textframe to inner table (or may be to cell in table).
var myPage = app.activeWindow.activePage;
var myTF = myPage.textFrames;
var myTable = myTF.tables;
Does this help?
Yes! This does work.
Thanks for help, Dave.