is the application "whatever" exists

is there a way to do this without it opening the application? when I do this follow:

if the application "Safari" exists then
end if

it will open safari, I want it to check if something exists without opening it, can this be done?

How’s this?

tell application "Finder"
	set x to ""
	set z to ((path to applications folder as text) & x)
		set Ap to z as alias
		display dialog x & " does exist!"
	on error
		display dialog x & " does not exist"
	end try
end tell


I’m using this handler


on check_Application_exists(theApp)
		tell application "Finder" to application file id theApp
		return true
	on error
		return false
	end try
end check_Application_exists

This works well StefanK, however it only works with applications that are scriptable, what if I want to see if a game that didn’t come with the computer exists or not? Or it might work with things that can’t be scripted, and I just don’t know how to format it.

It’s not required that the application is scriptable.
You need only the bundle identifier (in most of the cases the name of the preference file without the .plist extension)