Article View: adobe.scripting.indesign
Article #1700Re: [CS4 JS] Scripting Indexes
From: Peter Kahrel
Date: Tue, 27 Jan 2009 11:15
Date: Tue, 27 Jan 2009 11:15
21 lines
1507 bytes
1507 bytes
Ole was right: doScript() with UndoModes.fastEntireScript gives the best results. The test was a document without any formatting, no undo history, containing 36,000 characters. The script creates a character style and sets underline to true. Then it finds all "A" and "a" (2,680 instances), changes the contents of each found instance with "x" and applies the character style.
Results:
UndoModes.fastEntireScript 22.6, 22.8, 23.1
UndoModes.autoUndo 25.8, 25.8, 25.9
UndoModes.entireScript 26.3, 26.4, 26.5
UndoModes.scriptRequest 29.9, 29,3, 29.2
Conclusion: fastEntireScript lives up to its name and wins hands-down.
My next step, I thought, was to add from now on this line at the beginning of labour-intensive scripts:
app.activeScriptUndoMode = UndoModes.fastEntireScript;
But unfortunately, activeScriptUndoMode is read only. Time for a feature request.
Peter
Technical Details
Message-ID:
<59b7ae01.9@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossingReferences:
<59b7ae01.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,6b07b633d95c342d X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Peter Kahrel" <kahrel@kahrel.plus.com> Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: [CS4 JS] Scripting Indexes Message-ID: <59b7ae01.9@webcrossing.la2eafNXanI> Date: Tue, 27 Jan 2009 03:15:36 -0800 References: <59b7ae01.-1@webcrossing.la2eafNXanI> Lines: 24 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit