InDesign CS3 check for open docs and prompt for save

Hello everyone

I need to create a simple app to restore preference files of InDesign CS3 (Leopard) in case they become corrupt. I will use an osascript for removing and replacing the prefs files with the backed up ones, but I need before a script to check if InDesign is running and if it has some open docs to ask for saving them, and then proceed to the prefs replacement.

Thanks in advance

Kostas

Hi

Hopefully this will give you some ideas:

tell application "System Events"
	if exists process "Adobe InDesign CS3" then
		tell application "Adobe InDesign CS3"
			set thecount to count of every document
			if thecount is 0 then
				display dialog "Indesign is running, But no documents are open"
			else
				if thecount is greater than 0 then
					display dialog "Indesign is running, at least 1 document is open"
				end if
			end if
		end tell
	else
		display dialog "Indesign isn't running"
	end if
end tell

Thank you very much pigde1! Is it written in Leopard OS? Ive tried in Tiger OS and the first time it runs, opens InDesign even if it is closed.

Anyway it looks ok. I will try to tie it with the other proccess that I need and I will post back.

Thanks
Kostas

Hi

Yes i’m running leopard!
it didn’t activate my Indesign so not sure whats happened there.

Good Luck