Solved

Is the App running?

Posted on 1998-05-21
1
167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MongoDB Through a MySQL Lens

This article looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

628 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