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

 



Forgot your password?
typodupeerror
Get HideMyAss! VPN, PC Mag's Top 10 VPNs of 2016 for 55% off for a Limited Time ×
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:

Those who can, do; those who can't, write. Those who can't write work for the Bell Labs Record.

Working...