🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
1 messages
1 total messages Started by mps Tue, 03 Mar 2009 20:05
Loop actions through several open documents
#791
Author: mps
Date: Tue, 03 Mar 2009 20:05
14 lines
1681 bytes
I am on a mac using InDesign CS3. Code is all in Javascript.

Trying to get a loop to work for a series of actions, the purpose is to loop through all the actions for the top document then close that document and proceed to loop through the next, and so on until all are closed.

The problem is that since I am using Data Merge (part of the loop) a new document is created so when the loop is finished the copy is closed but the loop starts on the original document, creating an endless loop.

In other words I have documents "A", "B", and "C" open. Loop performs on A, makes a copy at the Data merge point (call it "A.1") then closes "A.1". At this point I want it to go to "B" but instead we start again with "A" and so on endlessly.

I wrote the following to try to skip the document on top for each cycle through but it doesn't work and I think the logic is flawed.

snippet:
for(myDocumentCounter = app.documents.length; i=0; myDocumentCounter > 0; myDocumentCounter--; i=i++){

Is there another to accomplish this? Maybe, is there a way to have the loop perform on all open documents "at once"?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads