• 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 23:25:53 -0500

On 2/7/01, I commented on "Re: emptyTrash command":

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


On further reflection and some testing, this may be a better way to go, unless you have extremely large numbers of files to deal with:

tell application "Finder"
set locked of every file of trash to false
set locked of every file of every folder of trash to false
empty
end tell

If someone has already addressed this, I apologize for repeating it. My ISP (RoadRunner) is experiencing severe email disruptions, and I don't think I'm getting all of my mail. The worst part is that they are saying it will take 7-10 days to fix the problem. What a load of crap!

Later,

Rob Jorgensen
Ohio, USA


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

  • Prev by Date: Re: emptyTrash command
  • Next by Date: Re: History of Scripting Terms (was Re: Attachability)
  • Previous by thread: Re: emptyTrash command
  • Next by thread: Re: How to "Tell" a varible name (solved??)
  • Index(es):
    • Date
    • Thread