Kept for archival purposes as OS X Finder can now natively sort by 'Date Added'.

Article date: 30 May 2007

Resources: 

  • Spot Meta

  • SpotInside (no longer active project)

  • MoRu (no longer active project)

  • Further reading: Articles from John Siracusa on Ars Technica about metadata here and here.

  • Dominic Giampaolos' (developer of the Be File System and member of Apples' file system and Spotlight groups) book 'Practical File System Design with the Be File System' here (PDF link).


Adding system wide 'Recently added' smart folder (well for your downloads folder/s at least) on Mac OS X 10.4.

The premise to this workflow/article is to simply have a folder act the same as iTunes 'Recently Added' smart does, but for your whole system. The workflow created here actually is functioning for my downloads folder Safari, Vienna and iChat as this is where most of the files arrive on my computer.

recentlyAdded.png

iTunes' 'Recently Added' smart playlist quickly identifies the most recent tracks you've added. So rather than search for a track you know you've just added you can use this folder and go straight to it. This is also like going into the Apple menu items' 'Recent Items' which lists the most recent applications, documents and servers used (though these are listed in alphabetical order, so something that you expect to be there, actually may not).

Finder doesn't provide such a 'search' option. I've tried using the search options 'Last Opened', 'Last Modified', and Created, none of these timestamp the files on arrival into a particular directory.

By using SpotMeta, one can set up their own dated 'extended attribute' and build a 'Folder Action' with Automator which can automatically timestamp files when arriving in those particular directory/s.

Enter SpotMeta

chooseKey.png

Create a 'New Date Key' from the Keys menu item.

Definitions.png

I've named my key 'Date added' but you could name it whatever makes sense to you. In iTunes it's named 'Recently Added'. Note that by default this will be added to 'Finder Favorites'.

SpotMeta-Preferences.png

In SpotMetas' Preferences, make sure you have installed the command line utility.

Automator

Open Automator. Choose 'Automator' from the Library list and then choose 'Run Shell Script' from the Action list and drag it into the workflow area.

automator1.png

Copy the settings and script as laid out above except for 'Date added', which you'll need to swap out with the name you gave the key. So if you name your key 'Recently Added' the main line of the script would read:

spotmeta set "d:Recently Added=now" "$f"

automator2.png

Save it as a Plug-in for Folder Actions and attach it to the folder to where your downloads go to.

Workflow in use

Each time a file is added to that folder/s, the current date and time is added to that file.

runningWorkflow.png

The menu bar will show that the workflow is running (it flicks off as soon as its run). This may seem inconvenient, but it is a confirmation that the attribute is being added to your files.

Viewing the files

AddedToday-1.png
AddedToday-2.png

These are the attribute options (Command J) to show in columns in Finders' 'list view', (all 7 of them) To see all the possible attributes to search with, choose 'Other' when in Finders' search mode (Command F).

Search-Attributes.png

If only this were the options to view by as well.

smartFolder.png

'Date Added' can not be chosen as a column, so the smart folder only lists that days (or however you set up the search) files in order of whatever view options you have chosen (e.g. alphabetically by name).

spotinsideWindow.png

SpotInside is designed for indentifying the text inside files that match your search criteria. But you can you use it to list your custom attributes and in this case, it lists them in dated order. SpotInside requires that you put the query format in its' preferences, so I find that it's not very useful on a daily basis. But is does give a view into how I'd like Finder to function. 

Actually using this workflow on a daily basis: It serves its purpose of showing only the current days downloads, though sometimes Finder takes a couple of seconds to re-search for the files. It is also recommended to re-scan if you haven't used the folder for a little while, but have still had that window open, just incase some files haven't been included.

refresh.png

Theoretical improvements

To be able to run the workflow completely in the background would be the ideal situation. I'm still hoping to accomplish this in Applescript (as apposed to Automator which builds a small script plus an application) but my limited scripting knowledge has yet to find a solution.

Viewing the ordered files via custom attribute will soon be sorted via MoRU, which is great for organizing your saved searches (Smart folders), can directly interact with SpotMeta and will soon one will be able to view custom metadata attributes (or any attributes the system supports) within a list view.

Instead of applying a custom attribute, the modification date could be changed to the current time/date upon entry into the directory. While this could be viewed more 'natively' within Finder, changing the modification date is not a solution for me as this attribute has its own purpose.