Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

An AppleScript to organize items by 'date added to folder' Desktop
I wrote a FolderAction (a while back actually) called FolderOrgX that will organize a folder by the date the files were added. This is perfect for my Downloads folder, as I can then easily see what was added on each date.

[robg adds: This little script worked perfectly for me, and it gets around the annoying problem of modification date vs. download date -- even though I keep my downloads folder organized by date, those dates usually don't reflect the date I actually downloaded the packge. This little script makes it quite easy to see what I downloaded when. The source is editable, too, so you can tweak it to your liking.]
    •    
  • Currently 2.75 / 5
  You rated: 4 / 5 (4 votes cast)
 
[16,317 views]  

An AppleScript to organize items by 'date added to folder' | 8 comments | Create New Account
Click here to return to the 'An AppleScript to organize items by 'date added to folder'' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to organize items by 'date added to folder'
Authored by: cansas on Nov 11, '03 11:14:16AM

This script is great! I use it every day. I did notice that it does not seem to work correctly if attached to a folder in a Filevault enabled user folder - I moved my downloads folder to a shared folder.



[ Reply to This | # ]
An AppleScript to organize items by 'date added to folder'
Authored by: bakalite on Nov 11, '03 04:45:39PM

Actually the script doesn't organize items by date, rather it moves them into folders that are organized by date. The difference is subtle, but important. I would love to have my downloads folder organized by when I downloaded something. However, having to deal with the folders makes it much less useful. Oh well...



[ Reply to This | # ]
An AppleScript to organize items by 'date added to folder'
Authored by: DeltaTee on Nov 11, '03 06:55:59PM

A script to add the date downloaded to the File Comments and then sorting by comments would not be incredibly difficult. A folder action could even be attached to automatically add the comment.



[ Reply to This | # ]
An AppleScript to organize items by 'date added to folder'
Authored by: biedawo on Nov 12, '03 12:27:15AM

Here is another applescript that will do something like this (suggestions welcome). As each file is added to the folder, the unix command touch is used to update the modification date to reflect when it was added to the folder. To use it, open the "applescript editor", paste it in, compile, and save in "/Library/Scripts/Folder Action Scripts"

Matt



(*
TimeStamp
touches each file as it gets added to the folder.
*)

on adding folder items to this_folder after receiving added_items
	repeat with i from 1 to the number of items in added_items
		set the_file to item i of added_items
		tell application "Finder"
			if (file the_file exists) then
				try
					do shell script ("/usr/bin/touch " & quoted form of POSIX path of the_file)
					update the_file
				end try
			end if
		end tell
	end repeat
end adding folder items to


[ Reply to This | # ]
folders, too
Authored by: Krioni on Nov 14, '03 04:21:07PM
Wouldn't that need to be

	if (item the_file exists) then
to handle folders, as well as files?

[ Reply to This | # ]
significant improvement to this script:
Authored by: SOX on Nov 22, '03 01:24:57PM
FolderOrgX automagically compartmentalizes your dowloads folder so it's organized by the date of the download. But it has some major drawbacks. I changed two lines in this script to fix two nuiscances this caused.

In its original form when you download two files with the same name or the same file twice, the script fails. Perhaps worse, when you download a file that safari can then open such as a .mov, .pdf, .dmg or .sit the folder action causes an error and safari does not open the item. I fixed this by instead of having the folder action move the file to a dated folder, it just creates an alias to the original in the dated folder but leaves the original in-place. Now safari can properly open the files and properly add suffixes to identically named files. to make this change open your copy of FolderOrg X in applescript editor and find the following two lines:


move file the_file to folder todaysfolder
set the label index of the_file to the 0
delete these (or comment them out) and replace them with this line

make new alias at folder todaysfolder to file the_file
A nice feature of this is that if you ever drag an original file out of the downloads folder the alias in your compartmental folders will continue pointing to it.

To easily delete all the originals for a given date(s) just select them in the finder then select "find originals" from the get_info or contextual menu. this will then select all the originals in the finder which you can then delete.

[ Reply to This | # ]

An AppleScript to organize items by 'date added to folder'
Authored by: kupietz on Feb 02, '06 01:19:06PM

I downloaded the new version. Maybe I'm doing something wrong, but it doesn't seem to do anything - I attached it as a folder action to my desktop folder, but when I download a file no dated folder is created, the DL'ed file just sits on my desktop as usual.

Also the new version uses terminal commands instead of straight Finder scripting so the above mod to make aliases isntead of actually moving the files doesn't work anymore.

It would be nice if the applescript-only version was still available for download.

Rats, this would have been really useful.



[ Reply to This | # ]
An AppleScript to organize items by 'date added to folder'
Authored by: truman on Aug 19, '09 01:19:49PM

I've used this script for years; couldn't live without it. I had to download it and install it again for a iMac I wiped clean and I had no problems with installing it.



[ Reply to This | # ]