Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
OS X

Journal commonchaos's Journal: Apple script to sort directory as you add files to it

This was written because I never like to delete stuff from my "Downloads" directory. I hate having to look through the directory for the last thing that I downloaded, that is where this comes in.

I have my browsers configured to not open my files after download, if I did, I would probably configure the delay to be more like 10 minutes or so.

on adding folder items to this_folder after receiving these_items
    tell application "Finder"
        set theDate to current date
        set todayDate to month of theDate & " " & day of theDate & ", " & year of theDate as text
 
        if not (exists folder todayDate of this_folder) then
            set the target_folder to (make new folder at this_folder with properties {name:todayDate})
            delay 2
        else
            set the target_folder to folder todayDate of this_folder
        end if
 
        repeat with i from 1 to number of items in these_items
            set this_item to item i of these_items
 
            move this_item to the target_folder
        end repeat
    end tell
end adding folder items to

This discussion has been archived. No new comments can be posted.

Apple script to sort directory as you add files to it

Comments Filter:

Beware of Programmers who carry screwdrivers. -- Leonard Brandwein

Working...