Skip to main content
Participant
January 22, 2010
Question

How to embed Script into InDesign file?

  • January 22, 2010
  • 2 replies
  • 2148 views

I have an indesign script that another member graciously put together; however, I am not sure how to utilize it in the InDesign file.  Can someone point me to a tutorial or give me some guidance on how I put this script into the InDesign file?  Thanks!!

var myDocument = app.activeDocument;

for(var i=myDocument.textFrames.length-1; i>=0; i--){

    for(var j=myDocument.textFrames.tables.length-1; j>=0; j--){

        for(var k=myDocument.textFrames.tables.rows.length-1; k>=0; k--){

            myContents = 0;

            for(var l=myDocument.textFrames.tables.rows.cells.length-1; l>=0; l--){

                if (myDocument.textFrames.tables.rows.cells.contents != "") myContents++;

                }

            if (myContents == 0) myDocument.textFrames.tables.rows.remove();

            }

        }

    }

This topic has been closed for replies.

2 replies

ramkumar_vp
Inspiring
January 23, 2010

Hi,


I think this script is used to delete the Empty row in tables.


If you want to use/run this you have to name this script as "[ScriptName].jsx" and copy this script to below path:


InDesign CS2: Adobe InDesign CS2\Preset\Scripts\

InDesign CS3: Adobe InDesign CS3\Scripts\Scripts Panel\


Then in InDesign "Window->Automation->Scripts" you can view the script.


By double clicking the script you can run.


Before running this script open the indesign doc having tables.


Regards,

Ramkumar .P


Jongware
Community Expert
Community Expert
January 22, 2010
Robert at ID-Tasker
Legend
January 23, 2010

[Jongware] wrote:

http://indesignsecrets.com/how-to-install-scripts-in-indesign.php describes the procedure.

I think he want to achieve something like APID and scripts "assigned" to objects ...

robin

www.adobescripts.co.uk

Harbs.
Legend
January 24, 2010

If he means APID or similar, he's going to need to optimize that script an awful lot...