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

noobsauce

macrumors member
Original poster
Mar 23, 2010
57
0
How do i kill a process (finder) using applescript and should i save it as a script, application or text?
 

Caleb531

macrumors 6502
Oct 17, 2009
289
0
This is the easiest way to restart the Finder:

Code:
do shell script "killall Finder"

The you can save the it as an application, and run it whenever you want to restart the Finder. Note that using the killall command normally force quits applications, the Finder and Dock are the only applications which will restart automatically.
 

larkost

macrumors 6502a
Oct 13, 2007
534
1
In this case dropping out to a shell script command is probably not the best way of doing what you want. The "killall" command will yank the rug out from underneath the Finder, not allowing it to do things it would normally do when closing (like saving its preference files). Plus you are dropping out of AppleScript in order to do something that AppleScript is better able to do.

The better, and simpler solution is this line in AppleScript:
Code:
tell application "Finder" to quit
 

noobsauce

macrumors member
Original poster
Mar 23, 2010
57
0
In this case dropping out to a shell script command is probably not the best way of doing what you want. The "killall" command will yank the rug out from underneath the Finder, not allowing it to do things it would normally do when closing (like saving its preference files). Plus you are dropping out of AppleScript in order to do something that AppleScript is better able to do.

The better, and simpler solution is this line in AppleScript:
Code:
tell application "Finder" to quit

I wrote a script that opens hundreds of finder windows and i need it to quit immediately before the computer crashes.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.