How to find out if an app is running?

Using applescript how can I find out if an app is running?
I seem to have some code with the following in:

if application "App Name" is active then

This gets the error, “The variable active is not defined”
Can anyone help?

tell application "System Events"
 if name of every process contains "SomeAppName"
  -- app is running
 else
  -- it isn't
end if