Rookie AppleScript question

Discussion in 'Mac Programming' started by zayjay, Oct 18, 2014.

  1. zayjay macrumors member

    zayjay

    Joined:
    Jul 24, 2008
    Location:
    Hangzhou
    #1
    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)
     

    Attached Files:

  2. Red Menace macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #2
    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).
     
  3. zayjay thread starter macrumors member

    zayjay

    Joined:
    Jul 24, 2008
    Location:
    Hangzhou
    #3
    Thank you Sir very much, issue solved!
     

Share This Page