🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18621

Re: Automatic document creation....

#18621
From: Shane Stanley
Date: Fri, 07 Mar 2003 10:12
31 lines
1746 bytes
I wonder if what you're actually trying to do is import the data in batches.
If so, you could use something like this:

set idPath to "Macintosh HD:The ID file"
set d ataPath to "Macintosh HD:The data"
set theStart to 1
set batchSize to 200
repeat
 tell application "InDesign 2.0.2"
  open idPath
  with timeout of 10000 seconds
   set theResult to import data from file (alias dataPath) into story
inDataStoryName using prototype story inDataPrototypeName starting with
record theStart ending with record (theStart + batchSize - 1)
  end timeout
  if theResult is 0 then
   -- end of data
   exit repeat
  end if
  save document 1 in (idPath & " " & theStart)
  close document 1 saving no
  if theResult is batchSize then
   set theStart to theStart + batchSize
  else -- must be at end of data
   exit repeat
  end if
 end tell
end repeat

-- 
Shane Stanley,  sstanley@myriad-com.com.au
Technical Details
Message-ID: <BA8EBBD5.50D7F%sstanley@myriad-com.com.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de82b86.-1@WebX.la2eafNXanI> <BA8E0B74.50AC8%sstanley@myriad-com.com.au>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,bd71a0f9f0c02c19
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-03-07 02:38:04 PST
From: Shane Stanley <sstanley@myriad-com.com.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Automatic document creation....
Message-ID: <BA8EBBD5.50D7F%sstanley@myriad-com.com.au>
Date: Fri, 7 Mar 2003 02:12:54 -0800
References: <1de82b86.-1@WebX.la2eafNXanI> <BA8E0B74.50AC8%sstanley@myriad-com.com.au>
Lines: 33
User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.0.6
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit