Article View: adobe.scripting.indesign
Article #20720Performance Problem (ID2)
From: Stuart Martin
Date: Wed, 12 Jun 2002 15:17
Date: Wed, 12 Jun 2002 15:17
36 lines
2153 bytes
2153 bytes
I have an 800 page document in ID2 just containing text, with approx 30 paragraphs on each page. I have been having a problem with the performance of scripts (written in VB) which I have written and therefore wrote a very basic script which inserts "hi" at the beginning of each paragraph for 10 paragraphs. The script is as follows:-
Private Sub Command1_Click()
Dim myInDesign As InDesign.Application
Dim myPub As InDesign.Document
Dim myTextFrames As InDesign.TextFrames
Dim myParagraphs As InDesign.Paragraphs
Dim i As Long
Set myInDesign = CreateObject("InDesign.Application.2.0")
Set myPub = myInDesign.ActiveDocument
Set myTextFrames = myPub.Pages(1).TextFrames
Set myParagraphs = myTextFrames(1).Paragraphs
i = 1
Do Until i = 10
myParagraphs(i).TextContents = "HI"
i = i + 1
Loop
Set myInDesign = Nothing
Set myPub = Nothing
Set myTextFrames = Nothing
Set myParagraphs = Nothing
MsgBox "Done"
End Sub
The problem I am having is that to run this script (running an 'exe' file with the script palette within ID2) is that it takes 20 secs to complete this simple task. I was wondering if anyone had any ideas on how to speed up this script, as it shouldn't take 2 secs to move to the next paragraph and insert two characters.
I am using Windows 98 with an 800mhz processor and 128mb of RAM.
Many thanks in advance
Stuart
Technical Details
Message-ID:
<ef914c2.-1@WebX.aaQKaf7vad4>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-05!supernews.com!feed.textport.net!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!news-x2.support.nl!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,78d3badb9daaa965,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-06-12 08:38:29 PST From: "Stuart Martin" <stuart@alpha-index.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-05!supernews.com!feed.textport.net!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!news-x2.support.nl!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Performance Problem (ID2) Message-ID: <ef914c2.-1@WebX.aaQKaf7vad4> Date: Wed, 12 Jun 2002 08:17:51 -0700 Lines: 16 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit