🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #15332

Re: [VB] Copy a table and paste it in a new page

#15332
From: Dave_Saunders
Date: Mon, 08 Dec 2003 18:30
26 lines
1682 bytes
You have to add it in its own text frame.

Depending on your needs, it could then be placed inline in its frame or placed freestanding on a page and then moved to the text stream where you want it.

Here's how (using JavaScript) to import a table in a text frame from a library to an insertion point in a text frame:

//reference to document
myDoc = app.documents[0];
//reference to active insertion point
myPt = app.selection[0].insertionPoints[0];
//select nothing
app.selection = null;
//reference to library (replace with name of your library)
myLib = app.libraries.item('PDSresources.indl');
//reference to asset containing text frame with sample table
myAsset = myLib.assets.item('SampleTable');
//place frame on document as freestanding
myAsset.placeAsset(myDoc);
//Frame is now selection so get reference
myTemp = app.selection[0];
//Move paragraph 1 of frame to desired insertion point
myTemp.parentStory.paragraphs[0].move(LocationOptions.atBeginning,myPt);
//Delete temporary frame
myTemp.remove();

Dave
Technical Details
Message-ID: <2cced027.2@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
References: <2cced027.-1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,50c714be408c8cfb
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-12-08 10:38:03 PST
From: Dave_Saunders@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: Re: [VB] Copy a table and paste it in a new page
Message-ID: <2cced027.2@webx.la2eafNXanI>
Date: Mon, 8 Dec 2003 10:30:21 -0800
References: <2cced027.-1@webx.la2eafNXanI>
Lines: 30
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit