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

Discussion in 'macOS' started by Yaja123, Nov 20, 2005.

  1. Yaja123 macrumors regular

    Joined:
    Mar 19, 2005
    #1
    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?

    thanks.
     
  2. generik macrumors 601

    generik

    Joined:
    Aug 5, 2005
    Location:
    Minitrue
    #2
    There is a way with terminal..

    Using iCal as an example, to start iCal I run the command /Applications/iCal.app/Contents/MacOS/iCal &

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

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

    Joined:
    Mar 19, 2005
    #3
    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. satans_banjo macrumors regular

    Joined:
    Sep 12, 2005
    Location:
    SE London
    #4
    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. kanaka macrumors member

    Joined:
    Jul 8, 2002
    #5
    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.
    Code:
    
    
     
  6. Yaja123 thread starter macrumors regular

    Joined:
    Mar 19, 2005
    #6
    just got around to it.

    never used a script until today...it works - whoooppee!

    thankyou :)
     
  7. Will Cheyney macrumors 6502a

    Will Cheyney

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

    Joined:
    Aug 23, 2011
    #8
    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?

    Thanks!
     
  9. Hansr macrumors 6502a

    Joined:
    Apr 1, 2007
    #9
  10. Jolly Jimmy macrumors 65816

    Jolly Jimmy

    Joined:
    Dec 13, 2007
    #10
    Woah old thread :D

    Try this :

    Code:
    tell application "App Name Goes Here"
    	activate
    	delay 300 -- delay before next action in seconds
    	quit
    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. sonaras macrumors newbie

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

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

    Joined:
    Jul 15, 2012
    Location:
    Czech Republic

Share This Page