Test for application active.

I have as script.

try
	set visible of windows of application "QuickTime Player" to not (visible of window 1 of application "QuickTime Player")
	
end try

It does what I want, except that if QuickTime is not running when I run the script, QuickTime starts.
On starting QuickTime loads some advertising window, but (before the window is completly loaded) the script notes that visible of window 1 is false and does what it is supposed to.

Is there a way to test if QuickTime is running before I inquire about the visiblity of its windows?

get running of application "QuickTime Player"

It will return true if it is running, false if it is not.

Thank you very much. The resulting script works perfectly.

try
	if (get running of application "QuickTime Player") then
		set visible of windows of application "QuickTime Player" to not (visible of window 1 of application "QuickTime Player")
	end if
end try

This board is very helpful.
Thanks.