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

lancestraz

macrumors 6502a
Original poster
Nov 27, 2005
898
0
RI
The downloads stack is pretty useful; but it's a pain having to delete the files stored there when you're done with them. I made an AppleScript that does this for you! Just place it in your downloads folder (or any folder) and click it when you want to cleanup.

Update: You can now change the name of this script to whatever you want and it will not delete itself.
For example: some people add a space to the beginning of the name so it will always appear first in the stack when sorting by name.
You can now place it in any folder and it will still work. thank xUKHCx for this.
If you want to exclude certain files or folders, open this script in "Script Editor.app" and add the name of the item you want to exclude to "items_to_excluded". Don't forget to add a files extension.
 

Attachments

  • DeleteAllNew.zip
    35.9 KB · Views: 2,174

stellarceltic

macrumors member
Oct 25, 2007
84
0
The downloads stack is pretty useful; but it's a pain having to delete the files stored there when you're done with them. I made an AppleScript that does this for you! Just place it in your downloads folder and click it when you want to cleanup.

Get it here.

BUMP

I've used this bad boy ever since you released it, and it has been a godsend. One problem though...

I want to put a space in front of the name so that it will always be in the front of my stack. I know I can just set the icon of the stack, but I want to be able to see if there are other things in the downloads folder.

Anyway, when I add space to the name, it deletes itself. I looked at the script and part of it says:

set the_items to (every item of (path to downloads folder as alias) whose name is not "Delete All.app")

I tried just putting a space in the name there and saved it, but it still deletes itself.

Anyone have any ideas?
 

MacDawg

Moderator emeritus
Mar 20, 2004
19,823
4,503
"Between the Hedges"
Change "Delete All.app" to " Delete All.app"

I think he tried that from reading his post

"I tried just putting a space in the name there and saved it, but it still deletes itself."

Woof, Woof - Dawg
pawprint.gif
 

lancestraz

macrumors 6502a
Original poster
Nov 27, 2005
898
0
RI
BUMP

I've used this bad boy ever since you released it, and it has been a godsend. One problem though...

I want to put a space in front of the name so that it will always be in the front of my stack. I know I can just set the icon of the stack, but I want to be able to see if there are other things in the downloads folder.

Anyway, when I add space to the name, it deletes itself. I looked at the script and part of it says:



I tried just putting a space in the name there and saved it, but it still deletes itself.

Anyone have any ideas?
Try this one.
Link. Link.
 

bluedoggiant

macrumors 68030
Jul 13, 2007
2,571
55
MD & ATL,GA
Try this one.
Link.

I used the icon to the left here:

http://interfacelift.com/icons-mac/details.php?id=1972

thats the icon instead of the downloads stack icon, so i click the empty box to clear my downloads stack.

lmao, i showed the application contents, then resources, then scripts, i read your script, and it said:

Code:
try
	tell application "Finder"
		set the_items to (every item of (path to downloads folder as alias) whose name is not "Delete All.app")
		delete the_items
	end tell
on error
	tell application "Finder" to display dialog "An error occurred!" with icon 0 buttons {"[B]Damn[/B]"} default button 1
end try

notice the damn in bold, i got rid of everything in my downloads stack and clicked the app, it didn't display that message, i think you need to get rid of the .ds store files and stuff, ill try again now by showing the hidden files

EDIT: nope, i think there is a problem
 

lancestraz

macrumors 6502a
Original poster
Nov 27, 2005
898
0
RI
I used the icon to the left here:

http://interfacelift.com/icons-mac/details.php?id=1972

thats the icon instead of the downloads stack icon, so i click the empty box to clear my downloads stack.
Cool icon. When I made the script, the current version of Leopard always displayed the first item in the stack, I used the "Downloads" folder icon so it would look like your download stack was empty when "Delete All.app" was the only item left. Now you can choose if the icon displayed is that of the first item in the stack or the folders icon that is the stack.

lmao, i showed the application contents, then resources, then scripts, i read your script, and it said:

Code:
try
	tell application "Finder"
		set the_items to (every item of (path to downloads folder as alias) whose name is not "Delete All.app")
		delete the_items
	end tell
on error
	tell application "Finder" to display dialog "An error occurred!" with icon 0 buttons {"[B]Damn[/B]"} default button 1
end try

notice the damn in bold, i got rid of everything in my downloads stack and clicked the app, it didn't display that message, i think you need to get rid of the .ds store files and stuff, ill try again now by showing the hidden files

EDIT: nope, i think there is a problem
You won't see the error if your "Downloads" folder is empty. You will only see it if there is an error in the execution of the program. Like if the Finder is not running or you don't have sufficient privileges to delete the items.
 

bluedoggiant

macrumors 68030
Jul 13, 2007
2,571
55
MD & ATL,GA
Cool icon. When I made the script, the current version of Leopard always displayed the first item in the stack, I used the "Downloads" folder icon so it would look like your download stack was empty when "Delete All.app" was the only item left. Now you can choose if the icon displayed is that of the first item in the stack or the folders icon that is the stack.


You won't see the error if your "Downloads" folder is empty. You will only see it if there is an error in the execution of the program. Like if the Finder is not running or you don't have sufficient privileges to delete the items.

Ahh, I see, I will have to try that sometime, i can imagine a 8 year old mac geek downloading it and getting that message, "mom, look, i got an error message," mom, "oh dear!"
:rolleyes:
 

xUKHCx

Administrator emeritus
Jan 15, 2006
12,583
9
The Kop
FYI if you want to make it universal as it folder agnostic so it will delete everything in whatever folder it is in you can use this line in the script

set the_items to (every item of (parent of (path to me as alias)) whose name is not "Delete All.app")
 

lancestraz

macrumors 6502a
Original poster
Nov 27, 2005
898
0
RI
Ahh, I see, I will have to try that sometime, i can imagine a 8 year old mac geek downloading it and getting that message, "mom, look, i got an error message," mom, "oh dear!"
:rolleyes:
You want to see the error message?

FYI if you want to make it universal as it folder agnostic so it will delete everything in whatever folder it is in you can use this line in the script
Good idea! Using the same general idea I updated the script so you can change it's name too.
 

bluedoggiant

macrumors 68030
Jul 13, 2007
2,571
55
MD & ATL,GA
i don't get it

well if you read my post, i got the script used in his application, when an error happens it says "an error occured" with a button that says "damn".

I used the icon to the left here:

http://interfacelift.com/icons-mac/details.php?id=1972

thats the icon instead of the downloads stack icon, so i click the empty box to clear my downloads stack.

lmao, i showed the application contents, then resources, then scripts, i read your script, and it said:

Code:
try
	tell application "Finder"
		set the_items to (every item of (path to downloads folder as alias) whose name is not "Delete All.app")
		delete the_items
	end tell
on error
	tell application "Finder" to display dialog "An error occurred!" with icon 0 buttons {"[B]Damn[/B]"} default button 1
end try

notice the damn in bold, i got rid of everything in my downloads stack and clicked the app, it didn't display that message, i think you need to get rid of the .ds store files and stuff, ill try again now by showing the hidden files

EDIT: nope, i think there is a problem
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.