Actions on frontmost app erroring

I have setup a script to execute actions depending on whether an app is active or not. It works for all programs but InDesign. Here is a script that should work.

if application "Adobe InDesign CS2" is frontmost then
	display dialog "yes indesign is front"
else
	display dialog "no it aint"
end if

If you substitute, say, finder for indesign in the app def, it works fine. Any ideas?

–edit-- I have also tried variations on the frontmost syntax like front, active and so on without result.

Help is greatly appriciated.
Chuckles :smiley:

I found a way to do it using system events.

tell application "System Events"
	tell application process "Adobe InDesign CS2"
		if frontmost then
			display dialog "whoooo"
		else
			display dialog "nooooo"
		end if
	end tell
end tell

Just thought I would share that…makes this post redundant I guess.
Chuckles :smiley: