Hello everyone. I use KM for a bunch of simple stuff. Now I want to do something a little more complex.
I have a network volume where I have a year/month/day folder structure. What I want to do is to trigger KM manually for it to run through all the files inside all the subfolders and attach the two newest ones to a new email, no matter where they are.
I can find the solution on the forum to get the newest one. However, I couldn't manage to expand it from there to the newest two files.
The solution you found won't work, because the sort by date function doesn't work with the recursive option of the For-Each-Item-In-A-Directory action.
The macro below works by:
Recursively looping through the source directory – extracting the modification date and file path of the given item – and appending them to a variable.