This version appends file name and modification date to columns A & B of the active worksheet.
I'm writing this for someone who wants to collate these statistics for new files added periodically to a folder.
-------------------------------------------------------------------------------------------
set watchFolder to alias ((path to home folder as text) & "test_directory:Watch_Folder_Test:")
set excelList to {}
set fileNameList to {}
set modDateList to {}
# Retrieve Name & Modification Date of the files in the watch folder.
tell application "Finder"
set fileAliasList to (files of watchFolder whose label index is not 6) as alias list
if fileAliasList = {} then error "No new files!"
set AppleScript's text item delimiters to " "
repeat with i in fileAliasList
set end of fileNameList to name of i
set end of modDateList to (get {short date string, time string} of (get modification date of i)) as text
set label index of i to 6
end repeat
end tell
# Convert the list of items to a list of lists.
repeat with i from 1 to (length of fileNameList)
set end of excelList to {item i of fileNameList, item i of modDateList}
end repeat
# Append data to columns A & B of the active worksheet.
tell application "Microsoft Excel"
tell active sheet of active workbook
set lastFilledCell to get end (range "A65536") direction toward the top
if value of lastFilledCell = "" then
set firstBlankCell to lastFilledCell
else
set firstBlankCell to get offset lastFilledCell row offset 1
end if
set cellAdrsLocal to get address local firstBlankCell
set AppleScript's text item delimiters to "$"
set lastRow to last text item of cellAdrsLocal
set newRange to cellAdrsLocal & ":$B$" & (lastRow + (length of fileNameList) - 1)
set value of range newRange to excelList
end tell
end tell
-------------------------------------------------------------------------------------------