The answer depends on what version of OSX you are running.
Snow Leopard doesn't appear to store Date Added or Creation Date of files.
$ stat -x testfile
Size: 7 FileType: Regular File
Mode: (0644/-rw-r--r--) Uid: ( 501/ vic) Gid: ( 20/ staff)
Device: 14,2 Inode: 12130091 Links: 1
Access: Mon May 5 21:49:18 2014
Modify: Mon May 5 21:49:15 2014
Change: Mon May 5 21:49:15 2014
For Lion and later, there are a couple of ways that Google revealed:
Try the following code taken from
tell application "Finder"
set latestFile to item 1 of (sort (get files of (path to downloads folder)) by creation date) as alias
set fileName to latestFile's name
log "Created/Added Date: " & (get creation date of latestFile)
Alternatively have a look at the code that uses the
mdls command line tool as shown here
Unfortunately I am running Snow Leopard and cannot test the above.