Repeating script till all documents are closed

Hi,

I’m a bit of a novice, so excuse my ignorance …
I’ve got an Indesign Script that exports the active document to pdf, then closes the file. I want it to repeat until ALL open documents have been exported and closed. I’m guessing this is an extremely simple command “ could someone point me in the right direction?

Thanks

Hi Sam,

something like this

tell application "InDesign CS"
	repeat while document 1 exists
		tell document 1
			-- do something
		end tell
	end repeat
end tell

Nice one, that’s worked fine.
Thanks very much.