Solved

Is the App running?

Posted on 1998-05-21
1
162 Views
Last Modified: 2013-12-26
Is there a way to get AppleScript to recognize if an applicatin is *not* running? I need to have an app run all the time and if it quits unexpectedly, or someone unknowingly quits it, I need AppleScript to automatically start it again.
0
Comment
Question by:jonsey
1 Comment
 
LVL 2

Accepted Solution

by:
gormenghast earned 50 total points
ID: 1291411
Hi

You need to create a script to run as an agent, you create an agent by setting the stay open option when saving your applescript application. You need to include a "run" and an "idle" handler and set its idletime to however frequently you want to check for the application. To check for the application use the following (substituting "Stickies" for whichever application you are checking for):

tell application "Finder"
      if (application "Stickies") is not in processes of it then
            tell application "Stickies"
                  activate
            end tell
      end if
end tell
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
repeatSeparator  java  challenge 13 57
method notes when mouse over in eclipse 5 87
Can not remove SSL certificate on iPhone 6 - iOS10.2 12 552
unix example issues 18 90
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question