Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Watch a software and if its not running then restart.

Can anyone spot a problem with this?


I have only been using automator since Wednesday and trying to solve a simple problem. I have been through 15+ pages of google but nothing is helping so thought it was best to post in here.


All I would like is for automator to check every 10 seconds to see if a piece of software called "IsadoraCore" is running. If not; restart the machine.


I know I can restart the software but I need it to restart the machine in order for IsadoraCore to trigger a series of events (start live feed video, etc) Its an interactive piece of software and quite clever but I need a failproof system.


Thanks!



repeat


delay 10

set core_is_running to ("IsadoraCore.app")

if core_is_running is false then

tell application ("Finder.app") to restart

end if

end repeat

MacBook Pro, Mac OS X (10.7.5)

Posted on Nov 2, 2012 3:12 AM

Reply
3 replies

Nov 2, 2012 6:16 AM in response to vjskulpture

you problem is that this is not the kind of thing automator was desinged to do. Automator is meant to run some task straight through, not for doing tasks that hang around waiting for a condition.


That being said, there are some odd things here. First, it seems weird that Isadora would have different behavior running at startup v. running manually. The app really shouldn't know whether it's a startup launch unless it was speciffically designed to make that distinction, and I can't imagine why any developer would do that. Are you sure tha information is correct? Second, every ten seconds is way too often. Launchd has a ten second throttle interval by default (i.e. it will actually block processes that try to restart faster than that).


The best solution would be to launch the app yourself using launchd and the KeepAlive key, which keeps the process always running, but we need to figure out oddness 1 before that will work.

Watch a software and if its not running then restart.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.