Add a "Delete All" item to the downloads stack

Discussion in 'OS X' started by lancestraz, Oct 26, 2007.

  1. macrumors 6502a

    lancestraz

    Joined:
    Nov 27, 2005
    Location:
    RI
    #1
    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.
     

    Attached Files:

  2. macrumors member

    Joined:
    Jul 4, 2007
    Location:
    Columbus, OH
  3. macrumors 65816

    haiggy

    Joined:
    Aug 20, 2003
    Location:
    Ontario, Canada
    #3
    Great idea, and good job.
    I hope Apple adds this functionality built in.. but for now yours is just fine.
     
  4. macrumors regular

    orbitalpunk

    Joined:
    Aug 14, 2006
  5. macrumors member

    Joined:
    Aug 11, 2006
    Location:
    Illinois
  6. macrumors regular

    Joined:
    Oct 30, 2007
    Location:
    Hong Kong, or Surrey, BC, Canada
  7. macrumors 6502

    Joined:
    Feb 24, 2005
    Location:
    S. Floriduh
  8. macrumors member

    Joined:
    Oct 25, 2007
    #8
    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?
     
  9. macrumors member

    Joined:
    Oct 25, 2007
    #9
    Anyone? It seems like there's a simple solution but I don't know the first thing about scripts...
     
  10. macrumors 6502a

    cheekybobcat

    Joined:
    Dec 26, 2007
    Location:
    U-S of A
    #10
    This is awesome! Great idea. You should pitch it to Steve :)
     
  11. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #11
    Change "Delete All.app" to " Delete All.app"

    Report it to bugreport.apple.com (ADC members) or apple.com/feedback/ (non ADC members).
     
  12. macrumors P6

    MacDawg

    Joined:
    Mar 20, 2004
    Location:
    "Between the Hedges"
    #12
    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 [​IMG]
     
  13. thread starter macrumors 6502a

    lancestraz

    Joined:
    Nov 27, 2005
    Location:
    RI
    #13
    Try this one.
    Link. Link.
     
  14. macrumors 68020

    bluedoggiant

    Joined:
    Jul 13, 2007
    Location:
    MD & ATL,GA
    #14
    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
     
  15. macrumors 68020

    techlover828

    Joined:
    Jun 28, 2007
    #15
    awesome!!! thanks for saving lots of time, your the man
     
  16. macrumors 6502a

    karenflower

    Joined:
    Dec 7, 2007
  17. thread starter macrumors 6502a

    lancestraz

    Joined:
    Nov 27, 2005
    Location:
    RI
    #17
    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.
     
  18. macrumors 68020

    bluedoggiant

    Joined:
    Jul 13, 2007
    Location:
    MD & ATL,GA
    #18
    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:
     
  19. Administrator emeritus

    xUKHCx

    Joined:
    Jan 15, 2006
    Location:
    The Kop
    #19
    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

     
  20. macrumors 68020

    techlover828

    Joined:
    Jun 28, 2007
    #20
    i don't get it
     
  21. thread starter macrumors 6502a

    lancestraz

    Joined:
    Nov 27, 2005
    Location:
    RI
    #21
    You want to see the error message?

    Good idea! Using the same general idea I updated the script so you can change it's name too.
     
  22. macrumors 68020

    bluedoggiant

    Joined:
    Jul 13, 2007
    Location:
    MD & ATL,GA
    #22
    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".

     
  23. macrumors regular

    Joined:
    Jul 13, 2007
    Location:
    New England
  24. macrumors member

    Joined:
    Oct 25, 2007
  25. thread starter macrumors 6502a

    lancestraz

    Joined:
    Nov 27, 2005
    Location:
    RI
    #25

Share This Page