Saving downloads to a subfolder?

Discussion in 'Mac Basics and Help' started by jacobp, Nov 28, 2007.

  1. jacobp macrumors member

    Joined:
    Nov 14, 2007
    #1
    I have my browser setup to save downloads to the Downloads folder. But within my Downloads folder I have setup subfolders to better organize the downloads.

    So now, when I download a file it places the file in Downloads and does not appear to have any flexibility in allowing me to drill down one level to the appropriate subfolder.

    Is there a way of setting up the Mac to allow me to do this?
     
  2. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    Yes, there is. Automator can watch folders and trigger actions when the folder's content changes - for instance, you could create an action that determines the file type of new files in the Downloads folder then moves them to a subfolder of your choosing, automatically. I'm assuming you're using Leopard. If you aren't, you'll need a little AppleScript to do this, instead.
     
  3. jacobp thread starter macrumors member

    Joined:
    Nov 14, 2007
    #3
    Thanks. But my situation is a bit different. I have subfolders in my Downloads folder that are named for the company that I am downloading the file from. So, for example, I have a HP Hardware subfolder and an Apple subfolder. It is, of course, probable that files with the same extensions would exist in both of those folders. So my question is still, is there a way to allow me to download a file and then steer the download to a specific subfolder. Thanks.
     
  4. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #4
    Ah, I see. It is still possible, but a bit more difficult. What you need is a small AppleScript that triggers as a Folder Action on the Downloads folder, moving files to subfolders based on some criteria it can identify the file by. For instance, if all your Apple downloads contain "Apple" in their filenames you can filter that way. If you're an AppleScript newbie, or don't know how to program in AppleScript, I'd be glad to write a script that does what you need.;)
     
  5. CrzyCanuck72 macrumors 6502a

    Joined:
    Jun 10, 2003
    #5
    or you could just set your browser to ask you every time where you want it to save your downloads, and then just choose the appropriate folder each time.
     
  6. jacobp thread starter macrumors member

    Joined:
    Nov 14, 2007
    #6
    I have tried the suggestion of having the Mac ask me where I want to save downloaded files, but it does not allow me to drill down any deeper than the Downloads folder. In other words, it will not allow me to drill down to a subfolder. Any suggestions.
     
  7. CrzyCanuck72 macrumors 6502a

    Joined:
    Jun 10, 2003
    #7
    click the blue triangle next to the name field to reveal your full file structure
     
  8. jacobp thread starter macrumors member

    Joined:
    Nov 14, 2007
    #8
    Yes, but it won't let you drill down inside one of the main folders.
     
  9. CrzyCanuck72 macrumors 6502a

    Joined:
    Jun 10, 2003
    #9
    what? if you click the blue triangle, you have access to every folder and subfolder on your computer.
     
  10. s2mcpaul macrumors member

    Joined:
    May 14, 2006
    #10
    HTML:
    property image_extension_list : {"tif", "tiff", "gif", "png", "pict", "pct", "jpg", "jpeg"}
    property video_extension_list : {"avi", "mov", "mpg", "mpeg", "wmv"}
    property audio_extension_list : {"mp3", "wav", "mp4", "aac", "m4a", "m4b"}
    property archive_extension_list : {"zip", "sit", "tar", "tgz", "gz", "bzip2"}
    property documents_extension_list : {"doc", "pdf", "txt", "xls", "ppt"}
    property application_extension_list : {"dmg", "hqx", "toast"}
    
    property image_foldername : "Images"
    property video_foldername : "Video"
    property audio_foldername : "Audio"
    property archive_foldername : "Archives"
    property documents_foldername : "Documents"
    property application_foldername : "Applications"
    
    
    on adding folder items to this_folder after receiving added_items
    	
    	repeat with this_item in added_items
    		tell application "Finder"
    			
    			if (the name extension of the this_item is in the image_extension_list) then
    				my makeamove(this_item, this_folder, image_foldername)
    			end if
    			
    			if (the name extension of the this_item is in the video_extension_list) then
    				my makeamove(this_item, this_folder, video_foldername)
    			end if
    			
    			if (the name extension of the this_item is in the audio_extension_list) then
    				my makeamove(this_item, this_folder, audio_foldername)
    			end if
    			
    			if (the name extension of the this_item is in the archive_extension_list) then
    				my makeamove(this_item, this_folder, archive_foldername)
    			end if
    			
    			if (the name extension of the this_item is in the documents_extension_list) then
    				my makeamove(this_item, this_folder, documents_foldername)
    			end if
    			
    			if (the name extension of the this_item is in the application_extension_list) then
    				my makeamove(this_item, this_folder, application_foldername)
    			end if
    			
    		end tell
    	end repeat
    end adding folder items to
    
    on makeamove(this_item, root_folder, target_foldername)
    	
    	tell application "Finder"
    		
    		if not (exists folder target_foldername of root_folder) then
    			make new folder at root_folder with properties {name:target_foldername}
    		end if
    		
    		set the target_folder to folder target_foldername of root_folder
    		my resolve_conflicts(this_item, root_folder, target_folder)
    		move file this_item to the target_folder
    		
    	end tell
    	
    end makeamove
    
    on resolve_conflicts(this_item, root_folder, target_folder) --renames the item if dublicate exists in target folder
    	
    	tell application "Finder"
    		
    		set file_extension to the name extension of this_item
    		set the file_name to the name of this_item
    		
    		if the file_extension is "" then
    			set the trimmed_name to the file_name
    		else
    			set the trimmed_name to text 1 thru -((length of file_extension) + 2) of the file_name
    		end if
    		
    		if (exists document file file_name of target_folder) then
    			
    			set the name_increment to 1
    			
    			repeat
    				set the new_name to (the trimmed_name & "_" & (name_increment as string) & "." & file_extension) as string
    				
    				if not (exists document file new_name of the target_folder) then
    					
    					set the name of document file file_name of folder root_folder to the new_name
    					exit repeat
    				else
    					
    					set the name_increment to the name_increment + 1
    					
    				end if
    			end repeat
    		end if
    	end tell
    	
    	return the file_name
    	
    end resolve_conflicts
     
  11. spinne1 macrumors 6502a

    spinne1

    Joined:
    Mar 12, 2005
    Location:
    Hermitage, TN USA (near Nashville)
    #11
    Assuming you are in Safari, right click on the file in question, select "Download linked file as..." and then you can select any folder or subfolder you want. To get where you want fast, make sure the Downloads folder is in your sidebar so you select it in case it is not already selected as your default (it should be unless you manually download elsewhere, in which case Safari remembers the last folder you downloaded to and automatically goes there again in the save dialog.)
     
  12. esses macrumors newbie

    Joined:
    Jun 17, 2011
    #12
    I have this same problem did you find a solution?
     
  13. Gregg2 macrumors 603

    Joined:
    May 22, 2008
    Location:
    Milwaukee, WI
    #13
    Um, his last post was 3-1/2 years ago.
    So now he'll show up and you can ask me, and your point is... ? ;)
     
  14. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #14
    The solution was properly described by CrzyCanuck72 on November 28, 2007. Just click the little blue triangle immediately to the right of the name field when saving, and you'll have access to every folder on the computer.

    jW
     

Share This Page