Path to application

How can i get path to application, if i only know its name?

set theAppToKill to “Safari”
tell application “Finder” to set KillThis to path of theAppToKill

Try something like this:

tell application "System Events"
	set killThis to application file of process "Safari"
end tell

Or with virtually the same words you used to ask the question. :slight_smile:

set theAppToKill to "Safari"
set KillThis to (path to application theAppToKill)

Both Bruce’s suggestion and this assume that the application’s actually running. The System Events script will at least have the decency to error if the application’s not running, whereas this will open the application, which is probably not what you want. However, it’s slightly faster and less to type otherwise.