i have an application on a server that would quit/crash once in a while and i would like to have a script to relaunch it automatically but i can’t find an event to trigger the applescript to reopen.
thanks for the help,
i have something like this
on run tell application "Finder" open file "Macintosh HD:Applications:TextEdit" end tell end run on idle tell application "Finder" if not (process "Macintosh HD:Applications:TextEdit" exists) then open file "Macintosh HD:Applications:TextEdit" end if end tell return 50 end idle
it works to a degree… it’s annoying to have it open up all the time while you’re working on something else… any thoughts?
(i’m using textedit as an example)
This might work:
tell application “TextEdit” to activate
tell application “Finder”
if not (process “TextEdit” exists) then
tell application “TextEdit” to launch
If the application is a script app, then you need to use the launch and run combo. Like:
tell app “MyScriptAppName”
This may not cover it all, so write back if no solution.
I played “Ghost Recon” alot on Gameranger. It has the option to “host” a game, where
your computer takes care of all the communications, but you are not there. The
problem I had was the same that you have. The application quits, and your not there
to restart it. So I wrote this. It might help you.