I’ve been working at this for the last two hours - there must be something I’m missing here, but I can’t seem to figure why this doesn’t seem to work. All I’m tring to do is return a list of files in specified folder that have been updated (based on modification date) in the last two weeks.
Here’s where I’m at
set aFortnightAgo to the (current date) - 14 * days
tell application "Finder"
set compList to get every item in folder "designated folder"
set manualUpdate to {}
repeat with newUpdated in compList
set theDate to modification date of (newUpdated as alias)
if theDate is greater than aFortnightAgo then
set updatedRecently to the name of newUpdated
end if
set manualUpdate to manualUpdate & updatedRecently
end repeat
end tell
Despite the fact that several files in my desiginated folder have been updated as recently as earlier today, this script fails to return any of those files. Its really frustrating me b/c when I take on of those files and test it indivually with a dumbed down script like this
set aFortnightAgo to the (current date) - 14 * days
tell application "Finder"
set theDate to modification date of file "designated file thats been recently updated"
if theDate is greater than aFortnightAgo then
beep
end if
end tell
everything works as it should. Clearly something goes wrong when I run it though the repeat, but I don’t know what. Sorry if this seems like an obvious one, but any help with this would be greatly appreciated!