Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×

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
            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:

To iterate is human, to recurse, divine. -- Robert Heller