Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Yaja123

macrumors regular
Original poster
Mar 19, 2005
164
0
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.
 

generik

macrumors 601
Aug 5, 2005
4,116
1
Minitrue
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>
 

Yaja123

macrumors regular
Original poster
Mar 19, 2005
164
0
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.
 

satans_banjo

macrumors regular
Sep 12, 2005
218
0
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
 

kanaka

macrumors member
Jul 8, 2002
86
0
Yaja123 said:
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.
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:
 

Yaja123

macrumors regular
Original poster
Mar 19, 2005
164
0
kanaka said:
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:

just got around to it.

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

thankyou :)
 

mlschmid26

macrumors newbie
Aug 23, 2011
1
0
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!
 

Jolly Jimmy

macrumors 65816
Dec 13, 2007
1,357
3
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.
 

sonaras

macrumors newbie
Jul 7, 2012
2
0
How about if I only want the auto close to work when the application is inactive for a certain period of time?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.