[JS] How to create a table in Javascript
Copy link to clipboard
Copied
Hello,
I am French and my English is poor. Sorry in advance if anything is unclear.
I would like to create a table entirely in javascript. An example:
How to make? I not find how to create rows and columns and how to fill cells with text ...
Thanks,
Copy link to clipboard
Copied
You could use the add() method for the Table object and define some properties:
var myTable = myTextFrame.insertionPoints[0].tables.add({columnCount:3,headerRowCount:1,bodyRowCount:1});
If you want to add properties, work on with the "myTable" variable…
For full documentation see:
http://www.jongware.com/idjshelp.html
Uwe
Copy link to clipboard
Copied
// reset the Find/Change dialog
app.findGrepPreferences = app.changeGrepPreferences = null;
// formulate a grep search string
app.findGrepPreferences.findWhat = 'hsm18.+?$';
// find all occurrence, last one first
f = app.activeDocument.findGrep (true);
for (i = 0; i < f.length; i++)
{
// construct file name
name = f.contents.replace (/@/g, '');
// place the pdf and REPLACE the destination with the folder of links
f.insertionPoints[0].place (File ('/Users/f-0262/Desktop/temp/' + name));
}
// delete all @??@ codes
app.activeDocument.changeGrep()
Copy link to clipboard
Copied
Hi Oriup,
this thread is about creating tables with ExtendScript.
Not about using GREP Find/Change.
Please add a new thread about your problem with a telling title here in the forum.
And also add a description of what you like to do with some words. What is working and what is not.
Regards,
Uwe
Copy link to clipboard
Copied
Hi Laubender,
I am new to forum, I have mistakenly place this code here.
I do not know how to delete.
By the way this code is find text and place image.
Sumit

