Message after close window

I am needing a very simple script that will display a custom message after a window is closed in adobe illustrator 10 or cs.

I know I am over thinking this, but am still drawing a blank.

Any help would be appreciated.

Thanks

macgod:

Here is a little hacked together bit of code. Save it as an application with the Stay Open option checked.


property messageDisplayed : false -- Initial state: Dialog has not been seen
on idle
	tell application "Illustrator CS"
		set docCount to (count of documents)
		if docCount = 0 and messageDisplayed = false then -- No docs opened / Dialog has not been seen
			display dialog "No documents open." -- Or whatever you want to say...
			set messageDisplayed to true -- Dialog has been seen. This needs to be set otherwise it will show the dialog over and over again.
		else if docCount > 0 then -- If there are docs open
			set messageDisplayed to false -- Reinitialize dialog as not seen
		end if
	end tell
	return 2 -- Vary this value for longer or shorter waiting times.
end idle

This isn’t necessarily the optimal solution since it’s just checking the count of open documents, not really responding to a close window call from Illustrator. You’d need to write a plugin to have that happen.

Jim Neumann
BLUEFROG