Autolaunch on crash

I am new to the Forum, so I hope I don’t breach some board etiquette. I have been meaning to learn AppleScript for a long time and I’d like to study at my own pace, but I have need of a software solution immediately and I can’t wait to figure it out on my own.

I am a speech pathologist who specializes in assistive technology for people with disabilities. I am working with a client who has quadriplegia from a high spinal cord injury. She uses an iMac quite proficiently using a software keyboard and mouse emulator controlled by switches she activates with her chin. The iMac is new and the switch interface is version 1.0 (i.e. potentially buggy).

The problem is that some of her older software (from her last computer) doesn’t play nice with, and crashes, the new keyboard and mouse software. When this software crashes this woman has absolutely no way to fix it. She has no input to the machine until a caregiver comes along and relaunches it with the real keyboard/mouse.

Obviously the offending software (a word prediction plugin for word processing) needs to be replaced, but it could happen again with something else.

I found this script on your site and I think it is what she needs. (Obviously replacing “TextEdit” with the name of the mouse emulator.)


on run
    tell application "TextEdit" to activate
end run

on idle
    tell application "Finder"
        if not (process "TextEdit" exists) then
            tell application "TextEdit" to launch
        end if
    end tell
    return 10
end idle

Questions: The crash causes a “Send Bug Report?” dialog box to come up. Does this need to be dismissed before the crashed program will relaunch?

Is this approach a bad idea because of something I’m not considering?

Any help would be greatly appreciated. Thanks.

I can not answer about the Bug Report.

The Applescript approach does work.

But you can also use the Launch agent.
Copy and paste the Code below into a PLAIN text file (you can use TextEdit)

Change the line
/Applications/TextEdit.app/Contents/MacOS/TextEdit
to
/Applications/YourApp.app/Contents/MacOS/YouApp

The Path /Applications/TextEdit.app/Contents/MacOS/TextEdit is the path to package contents of The app TextEdit.
You can see this if you right click on an app and select open Package contents.

save the file with the with the extention as a .plist (i.e. foo.plist)
Place it in the folder
/Users/USERNAME/Library/LaunchAgents/

Logout and then back in.
To seems to run at least every 10 seconds
To stop it just remove the file. (logout and in -I think)

[code]<?xml version="1.0" encoding="UTF-8"?>

Label Launch TextEdit OnDemand ProgramArguments /Applications/TextEdit.app/Contents/MacOS/TextEdit [/code] There is an app called [url=http://lingon.sourceforge.net/]Lingon[/url]. that can do this for you with it Assistant.

You can even use it to manage this file. (turn it on or off)