Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I was wondering if it is possible to have the following:

In my Downloads folder, I have 2 subfolders : IMAGES and VIDEOS. Is it possible to automatically move every image downloaded to the Downloads folder to the IMAGES folder, and if VIDEO files are downloaded in the Downloads folder, it should go into the VIDEOS subfolder?

I thought I could do it with Smart Folders but it does not seems to be working.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You can create two folder actions, one for images:

enter image description here

one for videos:

enter image description here

Both should be setup to receive files from Downloads folder.

The first step filters images and videos files.

The second step moves those files in the appropriate folder.

Be sure that folder action is attached to your Downloads directory (right click on directory, Services\Folder Actions Setup...).

To let Automator wait for the download to complete, you can add a Run AppleScript step, before the Move Finder Items step, similar to this:

on run {input, parameters}
    if input is {} then
        return {}
    end if

    repeat
        delay 1
        set {size:fileSize, busy status:Busy} to (info for (input as alias))
        if not Busy and (fileSize is greater than 0) then return input
    end repeat
end run

enter image description here

share|improve this answer
    
Great! Thanks a lot! So simple. Gotta love Automator! –  larin555 Nov 16 '12 at 14:23
    
The thing is that during the file download, it moves the temporary download file to the folder, so once the download is over, it makes an error. Is there anything to make it wait until the download is over? –  larin555 Nov 16 '12 at 14:37
    
I updated the answer with something that should work. –  Riccardo Marotti Nov 16 '12 at 15:43
    
It does not work. It downloads the file in the DOWNLOAD folder, but nothing happens after that. The file is not moving to the MUSIC folder –  larin555 Nov 16 '12 at 16:07
    
This is strange. The added script waits for the file to be released, then it passes it to the Move Finder Items step. I tested it on Mac OSX Lion. What version have you? –  Riccardo Marotti Nov 16 '12 at 16:32

Fill in the movieFiles property with the name extensions of the movies you will be dropping. Save the script in your folder actions folder and attach the folder action to your target folder

property movieFiles : {"mov", "m4v"}

on adding folder items to theFolder after receiving theFiles
    repeat with aFile in theFiles
        tell application "System Events"
            if name extension of aFile is in movieFiles then
                move aFile to (theFolder & "VIDEOS" as text)
            else
                move aFile to (theFolder & "IMAGES" as text)
            end if
        end tell
    end repeat
end adding folder items to
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.