-
1. Re: Knowledge Sharing: Scared...! table.duplicate() is not avalible in DOM
Laubender Mar 23, 2012 3:31 AM (in response to Green4ever)@Green – Hm. How would you do that task in the UI?
I think duplication of the texts object that holds the table would do
(not tested yet).Uwe
-
2. Re: Knowledge Sharing: Scared...! table.duplicate() is not avalible in DOM
Laubender Mar 23, 2012 3:44 AM (in response to Laubender)@Green – Now testing. The following snippet is working:
//Selection is a text frame that holds nothing but a table: var sel = app.selection[0]; sel.characters[0].duplicate(LocationOptions.AFTER,sel.insertionPoints[-1]);
To get to the specific character you want to duplicate you could also use the storyOffset property of a table object.
That gives you the insertion point before the character that represents the whole table.Uwe
-
3. Re: Knowledge Sharing: Scared...! table.duplicate() is not avalible in DOM
Green4ever Mar 23, 2012 6:07 AM (in response to Laubender)Hi Uwe,
In my case the selection is whole table. In that case what would be a good idea. Because the table is selected in a automated process.
//Selection must be a whole table var sel = app.selection[0]; sel.storyOffset.paragraphs[0].duplicate(LocationOptions.AFTER, sel.storyOffset.paragraphs[0].insertionPoints[-1]);
You can test this code....
---------------------
Green4ever
-
4. Re: Knowledge Sharing: Scared...! table.duplicate() is not avalible in DOM
Laubender Mar 23, 2012 6:41 AM (in response to Green4ever)@Green – I would try the following (just tested and does work):
var myTable = app.selection[0];//[object Table] var myInsertionPoint = myTable.storyOffset; //[object InsertionPoint] var imyInsPointIndex = myInsertionPoint.index; //Number var myStory = myInsertionPoint.parentStory; //[object Story] var myCharThatHoldsMyTable = myStory.characters[imyInsPointIndex]; myCharThatHoldsMyTable.duplicate(LocationOptions.AFTER,myStory.insertionPoints[-1]);
Uwe
-
5. Re: Knowledge Sharing: Scared...! table.duplicate() is not avalible in DOM
Green4ever Mar 23, 2012 9:33 PM (in response to Laubender)Hi Uwe,
Yeah It's working good. A good and neat approach to dupliacte the table. Thanks for you.
OT: I think adobe should look into this, and consider including method table.duplicate()
------------------
Green4ever


