Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Apple should either give us selective deletion of the trash (this shouldn't even be called a feature), or give us something innovative, like auto-purging based on a set of user defined criteria, like time since deletion, size of file, file type, which can be combined together.

I'd bet my AppleScript fits your needs, but if not, you should check out Compost.

mt
 
I am not against adding a "feature," I am against this attitude that people feel that just because they think something should be added, Apple's programmers should jump on it this second to "fix" it.

Fair enough. Just that this doesn't exactly take much effort to do.

No, because that's exactly what the Trash does.

I asked if it would hurt your productivity if Apple extended the Trash function as requested. My point is that you shouldn't care about something that doesn't impact your existing experience in any way.

Do you realize that your entire argument is nullified if you just use the Trash the way it is intended to be used? You haven't explained anything, other than you refuse to use the Trash in the way it is supposed to be used.

I have explained it many times. But you have a narrow minded view that Apple's Trash is the only way to handle file deletion. Many people including myself have explained that Window's Recycle Bin is better. Now, you may not agree it is better, but it is definitely an extended version of Apple's. But please stop telling us to put up with something that is missing a feature that we think is good. Granted, a feature that you and others may not use. But it is a feature that does not affect you in anyway. So please give it a rest.

Likewise if you request it, realize that what you're requesting is superfluous.

Superfluous to you, but as I said, not to us.

Then for God's sake, don't put it in a place where it could be deleted. Honestly, what is so hard to understand about that? Just because I don't use my wireless mouse all the time doesn't mean I store it in the garbage can by my desk.

And honestly, I don't know why you find it so hard to understand that different people have different habits. I respect you don't need the feature. Just accept that other people need it, OK? There are many other people in this thread who do not need this feature. Most of them have been very helpful by suggesting workarounds. Their posts are actually constructive!

As for the "feature" ... Hate to sound like a CIS nazi but if something is trashworthy, trash it. If you're not sure, create a folder called "is it trash?"

If you're still hellbent on having the "feature" it wouldn't take long to kludge something up in AppleScript and assign it a hotkey. Voila! Everyone's satisfied.

mt

Hi Mystery Tramp, thanks a lot for the script. Thanks for taking the time to write the code. I'll try it out. By the way, I prefer to delete files rather than to place everything in a "Is this trash?" folder because it's so much easier to hit the delete key, then to drag it to another folder.
 
And honestly, I don't know why you find it so hard to understand that different people have different habits.

My habit is robbing banks, but I don't need to change it. Banks just need to make it legal to walk in and take as much money as you want.

Argument fail.


I respect you don't need the feature. Just accept that other people need it, OK?

Liberal use of the word "need." There are a lot of things I think I need, also.
 
My habit is robbing banks, but I don't need to change it. Banks just need to make it legal to walk in and take as much money as you want.

Argument fail.

Wow. All I can think is "idgit". I mean, the point of view you espouse is not only unhelpful, it's obnoxious and pushes people away. My way or the highway? Fail? Guys, this guy is obviously trolling, and we all know not to feed the trolls.

Responding to others, I'd like to reiterate that the above proposed solutions do not solve the problem of what to do when you're using someone else's computer and you need to delete something from a USB key because it's full.

(Okay, `rm -Rf` solves everything, but most people aren't going to do that, and do you really want to be mucking around like that on a computer that's not yours? Moreover, turning the tables, do you want to have someone else mucking around your computer that way?)

I appreciate your solutions and work arounds, but feel they will always fall short in what I want to do. An earlier poster was wise in saying that Recycle Bin is an extension of Trash. I see a feature I like in it that's not present in Mac, and I don't seem to be the only one.

Lastly, if someone feels that Compost is worth paying for, it's obviously because Mac lacks something of commercial value. I would think this is an argument for Apple increasing the value of its OS by $20 with a very small software change, one that inconveniences no one, and makes a sizable subset of users happy.
 
... the above proposed solutions do not solve the problem of what to do when you're using someone else's computer and you need to delete something from a USB key because it's full.

I think you make a pretty good point here, possibly the best along this thread. I've rarely had external drives and if I put something in the trash, it's ready to be deleted. I'm sure I've deleted files I wished I didn't (I'd definitely cast a vote for full undelete included in the Finder), but I don't see the trash as just a folder where I can easily move things with a command-delete.

As such, when I had projects where I needed to delete specific files, or clean off a thumb drive, there never was a problem. The trash didn't have files I couldn't delete. But my experience might not be everybody's.

I don't think it would be terribly difficult to write a script to delete the files of just one drive. It won't be as elegant as a built-in feature, but it'll solve a problem until Apple changes the OS.

mt
 
...

I have explained it many times. But you have a narrow minded view that Apple's Trash is the only way to handle file deletion. Many people including myself have explained that Window's Recycle Bin is better. ...
Windows is an insecure bloated kludge. I will switch to the Mac. I want Apple to make MacOS X more like Windows.

Does that make sense?

The Windows Recycle Bin used to behave like the Mac Trash can. What the Windows switchers can't seem to grasp is that the Recycle Bin's current behavior is a Windows solution to a long standing Windows problem. The problem is that access to the Windows directory structure (folder hierarchy) is somewhat difficult:
  • Click My Computer.
  • Click C:\ or other drive.
  • Navigate the drive until you locate the folder that you want.
Unless the user places a shortcut to a specific folder on the Windows Desktop, Windows folders cannot be accessed from the Desktop--except for two folders, the Desktop itself and the Recycle Bin. Windows users rely on the Desktop much more so than Mac users. Storing items in the Recycling Bin helps to reduce clutter on the Desktop.

Navigating the Mac's directory structure is immeasurably more convenient. Most Mac users keep their startup drive conveniently located in the upper lefthand corner of their Desktop. All other mounted volumes are usually displayed beneath the boot volume. This is true of every Mac shipped since 1984. With the advent of MacOS X, we may also access each mounted volume from any open Finder window. With MacOS X 10.5, we may now even create a Stack from any folder and access it from the Dock. The upshot is that Mac users have no need for Recycle Bin storage because we have so many more logical options.

What of this notion of simply adding this extra feature for the convenience of those who want it? This is a seductively dangerous argument. The Trash's current behavior imposes the discipline of using the Trash for a single unambiguous purpose. Items in the Trash are items that the user believes are no longer needed. No if's, no and's, no but's. They may be kept in the Trash for the life of the computer, but there is no suspicion worry about them. They may be deleted at any time. In the event that a file is deleted in error, it can be recovered via third-party file recovery software or Time Machine.

If, however, Apple adds this "simple" feature treasured by some Windows users, then the nature of the Trash and our interaction with it will change in fundamental ways. No longer would we have the expectation that all items in the Trash are no longer needed. Before we delete the Trash, we would have to examine each file to ensure that it really was refuse. Accidental deletions would certainly increase necessitating the need for a file recovery function. Now Time Machine is an optional feature of MacOS X. With Trash storage, Time Machine would have to be enabled by default and would have to work from the boot volume.

A fire hose is a fantastic solution to a house fire. However, it would be really dumb idea to open up a fire hose on your house if it were not on fire. The Mac's house is not on fire. We should not open up the fire hose.
 
My habit is robbing banks, but I don't need to change it. Banks just need to make it legal to walk in and take as much money as you want.

Argument fail.

Liberal use of the word "need." There are a lot of things I think I need, also.

At least try to make sense. Whatever.
 
compost

Google "compost mac". Compost is a small, shareware utility that does exactly what you want, plus a couple of other things, like deleting items immediately, bypassing Trash, emptying trash only on a certain drive (like only on a thumbdrive), etc. I have had it on my Powerbook since 10.3 and it has been quietly and unobtrusively useful.
 
Hi MisterMe, thanks a lot for your long reply, which obviously took some time.

Windows is an insecure bloated kludge. I will switch to the Mac. I want Apple to make MacOS X more like Windows. Does that make sense?

It makes sense if the last sentence is worded differently as "I want Apple to make Mac OS adopt the good features of Windows, since it's impossible for any OS to be superior in every single feature." This is not about Mac vs Windows. This is about making an OS that's easier for everyone to use.

Navigating the Mac's directory structure is immeasurably more convenient.

I agree with your point that Mac OS's desktop is more user friendly than Windows - up to a point. For instance, you are correct to point out that mounted drives appear automatically on the Mac desktop, without the need to manually create a shortcut. Yet I don't think there is anything fundamentally different between Mac OS and Windows as far as file navigation is concerned. Mac OS is just better and easier, but I don't see the quantum leap taken by Apple that you have implied. Moreover, I am unsure about your comment on Stacks. Mounted drives do not appear automatically within Stacks. The shortcut has to be created, just like in Windows (which has had a less elegant Stack-like feature since Windows 95/98). I am also a little confused as to what all this has to do with the topic on hand and how we jump to the conclusion that:

The upshot is that Mac users have no need for Recycle Bin storage because we have so many more logical options.

The Trash's current behavior imposes the discipline of using the Trash for a single unambiguous purpose. Items in the Trash are items that the user believes are no longer needed. No if's, no and's, no but's.

This is basically the same argument used by countless others. It can be summarised as "this is the Apple way, and it should not be changed". Since you have been so kind to reply to me in such great detail, I will reciprocate. When a user deletes (i.e. places a file into the Trash), he assumes he no longer requires it. So what is the need for Trash? It is to prevent accidental deletion. I think we can all agree up to this point. Where there is a divergence of views is the definition of "accidental deletion". Although I don't want to use stereotypes, I shall do so here for the sake of convenience. "Mac" users consider accidental deletion as fat-finger errors, such as pressing the wrong key strokes or selecting the wrong files. Thus, they only require immediate recovery of the file. In that case, the current Trash behaviour works fine. For "Windows" users, we consider accidental deletion as a file that was considered worthless at the time of deletion, however, at a later time, the user discovers that he wish to retrieve it. For this scenario, the current Trash feature may not work, because the Trash may have been purged.

If, however, Apple adds this "simple" feature treasured by some Windows users, then the nature of the Trash and our interaction with it will change in fundamental ways. No longer would we have the expectation that all items in the Trash are no longer needed. Before we delete the Trash, we would have to examine each file to ensure that it really was refuse.

I don't see how adding the required feature would suddenly affect the way Trash is being used now by "Mac" users. No one is asking Mac users to change their behaviour. You use Trash the way you want to, and I will use Trash the way I want to. I don't get your argument, sorry.

A fire hose is a fantastic solution to a house fire. However, it would be really dumb idea to open up a fire hose on your house if it were not on fire. The Mac's house is not on fire. We should not open up the fire hose.

Er... this is a pretty simple feature. I am not asking the Mac OS to change from Unix to Solaris. By your argument, there is never any need to change the Mac OS unless it is absolutely "life or death" situation. Come on... don't give me this "if it ain't broke, don't fix it" argument. It's the same worthless argument that's been used time and again on this thread.

Only very few people have tried to be genuinely helpful and offered workaround solutions (copy everything in Trash to another folder and delete the items you don't want there), 3rd party programs (Compost) and Apple scripts (thanks MysteryTramp).
 
I'd like to reiterate that the above proposed solutions do not solve the problem of what to do when you're using someone else's computer and you need to delete something from a USB key because it's full.

I agree with everything you said. As for the above point, would using a guest account solve the issue? I suppose guests' deleted files would be stored in their own Trash rather than a communal Trash. In that case, he may then purge the Trash upon leaving, yet without affect other user's Trash. Am I wrong in this assumption?

But of course, normally, you wouldn't want to ask your friend to set up a guest account just to use his computer for a few minutes.
 
Can't we just make an automator workflow plug-in for the Finder that would move all the files except the ones selected into another folder temporarily, then empty the trash, then move the files back into the Trash?

Uh yeah that's already been done by MysteryTramp up there somewhere.
 
The earlier script was a big stinker. I knew that shortly after I posted it and wanted to fix it, but I've been jammed with other projects. This script is far better. Does some error checking, safe exits on obvious errors, handles folders and applications, handles multiple files.

No guarantees ... The thing deletes files so don't be surprised if a file gets deleted. There's some error checking built in to prevent some stupidity, but it can't anticipate everything.

Feel free to ask for feature enhancements ... no guarantees, though.

You need to unzip the attached script, or copy and paste the following into a Script Editor window. The script should be saved in the Finder Scripts folder (you might need to create one) inside:

home/Library/Scripts/Applications/Finder/

It'll appear at the bottom of the scripts menu (assuming you have scripts activated). If you want to give it a hotkey and you're using Leopard, you'll need to use Butler or something similar. Apparently 10.5.7 doesn't let you assign hotkeys to scripts. Shame. Hope Snow Leopard fixes that.

Code:
tell application "Finder"
	get the selection
	if the number of items of the result < 1 then
		display dialog "No file selected. Exiting" buttons {"OK"} default button "OK"
		exit repeat
	else
		repeat with theFile in the result
			set theVolume to the disk of theFile
			set itemPath to the quoted form of POSIX path of (theFile as text)
			set theDisplayedName to the displayed name of theFile
			if ".Trash" is in itemPath then
				if button returned of (display dialog "Are you sure you want to delete " & return & theDisplayedName & "?" & return & return & "Volume: " & theVolume buttons {"Yes", "No"} default button "No") is "Yes" then
					do shell script "rm -r " & itemPath
				end if
			else
				display dialog "This script only deletes files that are in the trash." buttons {"OK"} default button "OK"
			end if
		end repeat
	end if
end tell

Distributed as conscienceware. Do what your conscience says on attribution and distribution.

mt
 

Attachments

  • Delete Files in Trash.scpt.zip
    3 KB · Views: 389
Hey MysteryTramp!

Sorry to take so long to get back to you. I have been using your script and it's excellent. Everyone who is seeking for file deletion feature in Trash should be using your script.

Thanks a million for taking the time to help us out!

- - -
 
Thanks mysterytramp, I've been looking everywhere for something that could help me solve my problem with trash, and you just gave the easiest solution. I just created this account so I could thank you! I just wish this script was easier to find.

This little feature really is essential to me:) There are 3 main reasons I can think of that make this a necessary function:

1. You want to empty the trash in your USB drive but don't want to empty all your trash yet.
2. You are using someone else's Mac and want to delete a certain file, but don't want to empty the whole trash because you don't want to mess around with other people's stuff.
3. You don't want to empty the trash just yet (that's why they put the new "Put Back" command in Snow Leopard) but there's a huge file in the trash that's taking up loads of your HD space.

I hope Apple makes this an integrated feature, it's so simple that I really can't find any reason not to.

I also hope you don't mind, I've made a few small changes to your script:)

Code:
tell application "Finder"
	get the selection
	
	if the number of items of the result < 1 then
		beep
	else
		repeat with theFile in the result
			set theVolume to the disk of theFile
			set itemPath to the (theFile as text)
			set theDisplayedName to the displayed name of theFile
			if ":.Trash" is in itemPath then
				if button returned of (display dialog "Are you sure you want to permanently delete this file?" & return & return & theDisplayedName & return & "Stored in " & theVolume buttons {"Yes", "No"} default button "No") is "Yes" then
					do shell script "rm -r " & (quoted form of POSIX path of itemPath)
				end if
			else
				beep
			end if
		end repeat
	end if
end tell

Basically, I just changed the error messages to beeps (I find it more discreet that way) and changed the ".Trash" match to ":.Trash". This simply avoids a Trash false positive if you hypothetically had a folder named something like "something.Trash".

I highly recommend getting a free application called Spark
HTML:
http://www.versiontracker.com/dyn/moreinfo/macosx/22675
and just copying this script and then creating a shortcut for it.

Open Spark >> AppleScript

I like to use Shift+Backspace, works fine for me :)

BTW, how could you make the script delete the files all at once instead of one by one? Sorry, I don't know how to write in AppleScript, all I managed to do was change these little things... Thanks again!
 
The question might be stupid but is there any way to deleted some selected items from Trash??

As I see, either I can delete everything from Trash or none....

You can do it from a terminal, but you have to be a bit careful.

cd .Trash

rm filename (that'll have to be rm -rf if you are attempting to delete a trashed directory)

Be absolutely absolutely certain that you indeed are in .Trash BEFORE using rm -rf.
 
Thanks mysterytramp, I've been looking everywhere for something that could help me solve my problem with trash, and you just gave the easiest solution. I just created this account so I could thank you! I just wish this script was easier to find.

This little feature really is essential to me:) There are 3 main reasons I can think of that make this a necessary function:

1. You want to empty the trash in your USB drive but don't want to empty all your trash yet.
2. You are using someone else's Mac and want to delete a certain file, but don't want to empty the whole trash because you don't want to mess around with other people's stuff.
3. You don't want to empty the trash just yet (that's why they put the new "Put Back" command in Snow Leopard) but there's a huge file in the trash that's taking up loads of your HD space.

Yeah, MysteryTramp is real nice making that code for us. Really nice guy.

The points you made are concise and succinct. In my case, it's point number 3. Sadly, there are narrow minded fanboys on this forum, who refuse to accept that OTHERS need this function, even if they don't need it themselves.
 
The points you made are concise and succinct. In my case, it's point number 3. Sadly, there are narrow minded fanboys on this forum, who refuse to accept that OTHERS need this function, even if they don't need it themselves.

It's not a matter of being a fanboy or not. OS X simply does not have this functionality. Those that cry about what "should" and "shouldn't" be included in an operating system can either a) take steps to correct the situation themselves (like mysterytramp, for example, buying Pathfinder, or rm via Terminal), or b) shut up and deal with it.

Honestly it's not that big of a deal. Fix the problem yourself instead of whining about how unfair the world is for not letting you delete select items from the Trash by default.
 
It's not a matter of being a fanboy or not. OS X simply does not have this functionality. Those that cry about what "should" and "shouldn't" be included in an operating system can either a) take steps to correct the situation themselves (like mysterytramp, for example, buying Pathfinder, or rm via Terminal), or b) shut up and deal with it.

Honestly it's not that big of a deal. Fix the problem yourself instead of whining about how unfair the world is for not letting you delete select items from the Trash by default.

And rather that crying about what others on this forum "should" and "shouldn't" talk about, those people can shut up and deal with it. Honestly it's not that big a deal. Just ignore this post and stop whining about how unfair the world is for forcing you to read other people's opinions on features that they wish Mac OS X has.
 
Thanks mysterytramp, I've been looking everywhere for something that could help me solve my problem with trash, and you just gave the easiest solution. I just created this account so I could thank you! I just wish this script was easier to find.

This little feature really is essential to me:) There are 3 main reasons I can think of that make this a necessary function:

1. You want to empty the trash in your USB drive but don't want to empty all your trash yet.
2. You are using someone else's Mac and want to delete a certain file, but don't want to empty the whole trash because you don't want to mess around with other people's stuff.
3. You don't want to empty the trash just yet (that's why they put the new "Put Back" command in Snow Leopard) but there's a huge file in the trash that's taking up loads of your HD space.

I hope Apple makes this an integrated feature, it's so simple that I really can't find any reason not to.

I also hope you don't mind, I've made a few small changes to your script:)

Code:
tell application "Finder"
	get the selection
	
	if the number of items of the result < 1 then
		beep
	else
		repeat with theFile in the result
			set theVolume to the disk of theFile
			set itemPath to the (theFile as text)
			set theDisplayedName to the displayed name of theFile
			if ":.Trash" is in itemPath then
				if button returned of (display dialog "Are you sure you want to permanently delete this file?" & return & return & theDisplayedName & return & "Stored in " & theVolume buttons {"Yes", "No"} default button "No") is "Yes" then
					do shell script "rm -r " & (quoted form of POSIX path of itemPath)
				end if
			else
				beep
			end if
		end repeat
	end if
end tell

Basically, I just changed the error messages to beeps (I find it more discreet that way) and changed the ".Trash" match to ":.Trash". This simply avoids a Trash false positive if you hypothetically had a folder named something like "something.Trash".

I highly recommend getting a free application called Spark
HTML:
http://www.versiontracker.com/dyn/moreinfo/macosx/22675
and just copying this script and then creating a shortcut for it.

Open Spark >> AppleScript

I like to use Shift+Backspace, works fine for me :)

BTW, how could you make the script delete the files all at once instead of one by one? Sorry, I don't know how to write in AppleScript, all I managed to do was change these little things... Thanks again!

Thanks and thanks also to mysterytramp, who first made this.

I was using "rm -r," but this much better, since it also allows you to delete multiple files easily. For those wondering how to use it, just open up trash and then click on this script. I suggest dragging the script to the top of finder (where the icons are) and then you'll have it always right there.
 
And rather that crying about what others on this forum "should" and "shouldn't" talk about, those people can shut up and deal with it. Honestly it's not that big a deal. Just ignore this post and stop whining about how unfair the world is for forcing you to read other people's opinions on features that they wish Mac OS X has.

The difference between me suggesting that people either a) solve their problem or b) quit whining about it is that those are actually realistic ways to deal with the situation. The amount of hot air that gets wasted hoo-hawing about what "should" happen on these forums is astounding. People would be much better off assessing their realistic options instead of crying about what's not going to happen.

It's for your own benefit, take it or leave it.
 
#1)
kubark42 said:
miles01110 said:
My habit is robbing banks, but I don't need to change it. Banks just need to make it legal to walk in and take as much money as you want.

Argument fail.

Wow. All I can think is "idgit". I mean, the point of view you espouse is not only unhelpful, it's obnoxious and pushes people away. My way or the highway? Fail? Guys, this guy is obviously trolling, and we all know not to feed the trolls.

#2)

Fix the problem yourself instead of whining about how unfair the world is for not letting you delete select items from the Trash by default.

For solution to #2, see solution to #1.

Moving on: Wondersnite, that's a real good upgrade. That's exactly what we've been waiting for. acidity doesn't seem to be a current user anymore, so the PM I sent him to ask to update his original question might well have fallen into the abyss. Could some moderator take it upon himself to edit the original post, in order to point out that Wondersnite and mystertramp have created a (practically) turnkey solution?
 
The difference between me suggesting that people either a) solve their problem or b) quit whining about it is that those are actually realistic ways to deal with the situation. The amount of hot air that gets wasted hoo-hawing about what "should" happen on these forums is astounding. People would be much better off assessing their realistic options instead of crying about what's not going to happen.

It's for your own benefit, take it or leave it.

My original post and subsequent ones (except my replies to you) were written with the intent to make a suggestion and to seek workarounds (which is what any forum is about). It seems some people agree with me (and others not). If enough people want it, Apple will make a change. It's quite realistic. Do you understand the simple concept of market forces? Or should no suggestion ever be made?

You, on the other hand is a different matter. You just belittle others as whining because you disagree with other people's opinions. You are a fanboy - please admit it - because you cannot allow people to suggest modifications to the glorious OS X. I am perfectly happy to have people come to me and say the "feature" I requested is not something they need. I am also happy if someone disagrees with me, and say the implementation of a feature will negatively affect them. Some have said this, and you don't see me trying to change their minds. I do however have an issue with you and people like you, who have this attitude that we should just put up with whatever Apple gives us. You people try to control what I should and should not write on a public forum, one which is not moderated nor owned by you. I have differences in opinion with others, but I do not tell them to shut up and deal with it. You should learn to treat others with more respect.

And you know what, I am astounded to see you waste your hot air, telling others what they should and should not write about, when none of us are going to stop just because you whine about it. And yes, you are in fact the one doing all the whining. Because what you have said on this forum is totally unconstructive. Goodbye fanboy.
 
Better way to delete multiple files in trash.

I modified mysterytramp's and Wondersnite's code to allow one to delete a number of files (or just one file) from the trash. I found it to be kind of annoying to keep having to answer, yes, if I wanted to delete two or more files, for each file.

Code:
tell application "Finder"
	
	if button returned of (display dialog "Are you sure you want to permanently delete these files?" buttons {"Yes", "No"} default button "No") is "Yes" then
		
		get the selection
		
		if the number of items of the result < 1 then
			beep
		else
			repeat with theFile in the result
				set theVolume to the disk of theFile
				set itemPath to the (theFile as text)
				if ":.Trash" is in itemPath then
					do shell script "rm -r " & (quoted form of POSIX path of itemPath)
				else
					beep
				end if
			end repeat
		end if
	end if
end tell
 
Most Mac users keep their startup drive conveniently located in the upper lefthand corner of their Desktop.
Or the other upper left hand corner. ;)

It seems some people agree with me...
C'est moi.
I've never owned any computer other than a Mac. I've used Windows at work. I use the "temporary move" workaround for Trash, especially when it comes to removables with things I've deleted and want to be rid of permanently. I too wish that Trash had selective banishment. It would just fit my habits better. I love that Apple allows for choice in so many other areas. I wish they'd add this one too.

Amazing that some of the same people are still following this thread whenever it gets revived!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.