is there a way to do this without it opening the application? when I do this follow:
if the application "Safari" exists then
beep
end if
it will open safari, I want it to check if something exists without opening it, can this be done?
is there a way to do this without it opening the application? when I do this follow:
if the application "Safari" exists then
beep
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 "Safari.app"
set z to ((path to applications folder as text) & x)
try
set Ap to z as alias
display dialog x & " does exist!"
on error
display dialog x & " does not exist"
end try
end tell
Hi,
I’m using this handler
check_Application_exists("com.apple.Safari")
on check_Application_exists(theApp)
try
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)