Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Script to re-date folder to contents logic problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="emilycurious" data-source="post: 1745426" data-attributes="member: 361999"><p>Hi,</p><p>I need to write an applescript to re-date folder(s) to the latest date of the folder contents.</p><p>(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.)</p><p>I don't know how to do any of this, but I'll work it out!</p><p>However, I have a logic problem that I can't work out.</p><p>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.</p><p>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?</p><p>Am I explaining this well enough?</p><p></p><p>(10.12.2)</p></blockquote><p></p>
[QUOTE="emilycurious, post: 1745426, member: 361999"] 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) [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Script to re-date folder to contents logic problem
Top