Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).

×
OS X

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

Journal by commonchaos

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:

Due to lack of disk space, this fortune database has been discontinued.

Working...