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

zayjay

macrumors member
Original poster
Jul 24, 2008
42
3
Hangzhou
Hello, I'm very new to AppleScript, and I want to write a little app to tell the Finder to empty trash. "tell application "Finder" to empty trash", but I got this confirming window everytime I run the script.
What should I put in the script to tell the app to default pick the "Empty Trash" button.

Thank you all in advance!
(I'm on 10.10)
 

Attachments

  • Screen Shot 2014-10-18 at 4.26.16 PM.jpg
    Screen Shot 2014-10-18 at 4.26.16 PM.jpg
    27.8 KB · Views: 140
The Finder has a preference to warn you before it empties the trash - if you don't want the warning, you can change the preference. Alternatively, you can bypass the Finder and use the rm or srm shell utilities (be sure to understand these utilities before using them).
 
The Finder has a preference to warn you before it empties the trash - if you don't want the warning, you can change the preference. Alternatively, you can bypass the Finder and use the rm or srm shell utilities (be sure to understand these utilities before using them).

Thank you Sir very much, issue solved!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.