I’ve got small launcher script, which launches some apps on system startup. Lately, I’ve deleted on of the apps and every time it launches it shows me a browse window to locate that missing app. Is there a way just to tell it to ignore if there is no app – just skip it.
Here is what I’ve tried:
try
tell application "junk2" to launch
on error
set myMessage to "Error launching " & appName
end try
So, all I need to set myMessage to error message and continue. How to proceed?
Thanks
You need the command “using terms from application” (google it for a detailed explanation). This will work if you save your applescript code as an application and you must create it on a computer which has the application. These two things will prevent the need for the script to compile on the computer running the code, which will prevent the error if you create it as I explained. So in this script we use mdfind to check if the application exists on the computer, and if so launch the app…