• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: emptyTrash command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emptyTrash command


  • Subject: Re: emptyTrash command
  • From: Rob Jorgensen <email@hidden>
  • Date: Wed, 7 Feb 2001 20:11:45 -0500

On 2/7/01, Braulio Gonzales commented on "emptyTrash command":

Using apple script is there a way to use the command, emptyTrash, to permenatly delete locked folders or files, the following scripts don't seem to work;

tell application "Finder" to empty the trash
tell application "Finder" to empty trash

You could try this:

-- Warning: this WILL delete everything in the Trash, without warning.

tell application "Finder"
set lockedFiles to every item of trash whose locked is true
repeat with i from 1 to (count of lockedFiles)
set locked of item i of lockedFiles to false
end repeat
empty
end tell

-- <Insert normal "Don't blame me..." disclaimer here> :p

FYI, I don't think you can lock folders, although they may remain in the Trash if they contain locked files.

Later,



Rob Jorgensen
Ohio, USA


  • Follow-Ups:
    • Re: emptyTrash command
      • From: Rob Jorgensen <email@hidden>
References: 
 >emptyTrash command (From: "Braulio Gonzales" <email@hidden>)

  • Prev by Date: Re: Add command to Contextual Menu?
  • Next by Date: Re: emptyTrash command
  • Previous by thread: emptyTrash command
  • Next by thread: Re: emptyTrash command
  • Index(es):
    • Date
    • Thread