Any way to close an app automatically? Schedule? Automator?

Discussion in 'OS X' started by Yaja123, Nov 20, 2005.

  1. macrumors regular

    Mar 19, 2005
    Any way to close an app automatically? Schedule? Automator?

    I dont know much about these things. I have a program i use called IMSafe and Webstractor which i can get to open automatically using ical but i dont know how to close it.

    anyone know?

  2. macrumors 601


    Aug 5, 2005
    There is a way with terminal..

    Using iCal as an example, to start iCal I run the command /Applications/ &

    It will then display a number which is the process ID.

    To kill it just type kill <process id>
  3. thread starter macrumors regular

    Mar 19, 2005
    i dont understand... maybe i should clarify.

    eg, I have IMSafe open at 2.40 pm everyday (using ical alarm feature - open file).. it then does its automated backup of various files. THEN what i would like is for it to close/quit automatically at 2.50pm without my intervention, just as it open without me doing anything.
  4. macrumors regular

    Sep 12, 2005
    SE London
    get iCal to run a script at the time you want it to shut down. that script should activate the terminal command that generik just mentioned
  5. macrumors member

    Jul 8, 2002
    There are several ways to do this, but if you want to schedule the app to quit automatically with iCal here's one thing you can do:

    1. Open Script Editor (in /Applications/Apple Script/)
    2. Create a new script with this line:
      tell application "IMSafe" to quit
    3. Save the script somewhere and name it something like "Quit IMSafe"
    4. In iCal, schedule a new event at 2:50pm, and for the alarm select "Run Script". Then click the popup below which says "none", select "other", then select your "Quit IMSafe" script.
    I just tested this with Stickies.
  6. thread starter macrumors regular

    Mar 19, 2005
    just got around to it.

    never used a script until works - whoooppee!

    thankyou :)
  7. macrumors 6502a

    Will Cheyney

    Jul 13, 2005
    United Kingdom
    Awesome. I didn't know iCal could schedule the launch of a file!
  8. macrumors newbie

    Aug 23, 2011
    Anyway to produce this same result (i.e. close an application) after a set amount of time, say 5 or 10 minutes after start up.

    I have an application that opens at start up, connects to the internet, but does not close. I would like it to close after it does it's thing, about 5 minutes after start up.

    Is there a script or way to use Automator to accomplish this task?

  9. macrumors 6502a

    Apr 1, 2007
  10. macrumors 65816

    Jolly Jimmy

    Dec 13, 2007
    Woah old thread :D

    Try this :

    tell application "App Name Goes Here"
    	delay 300 -- delay before next action in seconds
    end tell
    Open it in AppleScript Editor and save it as an application, then add it to your login items instead of the app.
  11. macrumors newbie

    Jul 7, 2012
    How about if I only want the auto close to work when the application is inactive for a certain period of time?
  12. macrumors member

    Nov 14, 2013
    Bump for an old thread. I want to know the answer to this question too.
  13. macrumors 6502

    Jul 15, 2012
    Czech Republic

Share This Page