- Joined
- Oct 20, 2015
- Messages
- 6
- Reaction score
- 0
- Points
- 1
Hi,
I need to write an applescript to re-date folder(s) to the latest date of the folder contents.
(Right, now I open a folder, open a file in there, make no changes and/or do not save, so the file modification date does not change, but the folder mod date does. I need it to show the same date as the last modified file.)
I don't know how to do any of this, but I'll work it out!
However, I have a logic problem that I can't work out.
So, I need the script to cycle through all the files in a folder looking at their modification dates, and then if file B is older than file A I want to ignore it an go to file C, and if that file date is more recent than A, I want to keep C and ignore A.
But, how do I get the first instance into the loop? I figured I need a known very old start date, say set compareDate to 01/01/01, but then, how do I leave that out of the loop for the second comparison?
Am I explaining this well enough?
(10.12.2)
I need to write an applescript to re-date folder(s) to the latest date of the folder contents.
(Right, now I open a folder, open a file in there, make no changes and/or do not save, so the file modification date does not change, but the folder mod date does. I need it to show the same date as the last modified file.)
I don't know how to do any of this, but I'll work it out!
However, I have a logic problem that I can't work out.
So, I need the script to cycle through all the files in a folder looking at their modification dates, and then if file B is older than file A I want to ignore it an go to file C, and if that file date is more recent than A, I want to keep C and ignore A.
But, how do I get the first instance into the loop? I figured I need a known very old start date, say set compareDate to 01/01/01, but then, how do I leave that out of the loop for the second comparison?
Am I explaining this well enough?
(10.12.2)