Working from a selected drive or folder, is it possible to have an action or macro create a list of all files created or modified after a specific date?
Thanks for the help.
Forum, am I asking too much of the Keyboard Maestro program here?
I think you can do:
1.- filter files from Finder and
2.- use KM to save it as a list
That gives me a starting place, thanks.
Yes, but it requires a script.
Below is just an example written in response to your request. You will need to use as an example and/or change to meet your workflow automation needs.
Please let us know if it meets your needs.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Example Output
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MACRO: Get List of Files in Folder Created or Modified After Given Date [Example]
-~~~ VER: 1.0 2021-03-25 ~~~
Requires: KM 8.2.4+ macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))
DOWNLOAD Macro File:
Get List of Files in Folder Created or Modified After Given Date [Example].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.
ReleaseNotes
Author.@JMichaelTX
PURPOSE:
- Get List of Files in Folder Created or Modified After Given Date [Example]
- Returned List is in Alphabetic Order
HOW TO USE
- First, make sure you have followed instructions in the Macro Setup below.
- See the below "How to Use" Comment Action
- This macro is just an example written in response to your request. You will need to use as an example and/or change to meet your workflow automation needs.
MACRO SETUP
- Carefully review the Release Notes and the Macro Actions
- Make sure you understand what the Macro will do.
- You are responsible for running the Macro, not me. ??
.
Make These Changes to this Macro
- Assign a Trigger to this Macro .
- Move this macro to a Macro Group that is only Active when you need this Macro.
- ENABLE this Macro, and the Macro Group it is in.
- For more info, see KM Wiki article on Macro Activation
.
- For more info, see KM Wiki article on Macro Activation
- REVIEW/CHANGE THE FOLLOWING MACRO ACTIONS:
(all shown in the magenta color)- CHANGE to Default Target Date
- Default is One Month prior to Today
- CHANGE to Default Target Date
REQUIRES:
- KM 9.0+ (may work in KM 8.2+ in some cases)
- macOS 10.12.6 (Sierra)+
TAGS: @Example @Files @AppleScript @SystemEvents @Date
Thank you very much, I can't wait to "get into it" !
I have no doubt the sample macro posted by JMichaelTX works well—I haven't tested it but he regularly posts effective macros like this—but just a reminder to anyone reading that from the Finder, using File > Find (Command-F) invokes a Spotlight window whereby the Created and Modified criteria (and many more) can be specified for a search.
Thank you very much for the helpful and useful macro, it works so smooth I can't believe it. I'm amazed looking at it in KM, following your steps (although way out of my league) is an eye opener.
Thanks again
NaOH, thanks for the Spotlight info. I'll be studying that as well.
Much appreciated
Hey Folks,
⌘⌥F puts you in the Window Search Field without bringing up the advanced UI.
From there you can enter pretty sophisticated queries:
date
in the above is somewhat generic – you have to use Spotlight query language to get more specific:
kMDItemContentModificationDate:>3/1/2021 NOT kind:folder
I have a number of these kinds of queries pre-built in Typinator, so it's easy for me to compose fairly sophisticated stuff if I need to.
You can also use the Raw
category in the advanced Spotlight UI, but you most likely have to enable it from the Other... in the Spotlight pop-up criteria menu.
If you look in the displayed pop-up-menu you can see I've already enabled Raw Query
.
Supposedly as of Catalina English-Language searches are better supported, but I'm still using Sierra and Mojave and can't test as yet.
-Chris
Hey Folks,
Here's how you can drive Spotlight from Keyboard Maestro using an Execute a Shell Script action.
- The macro will pop-up a list of found paths.
- Dates need to be in iso-format and may include (nor not) the time in 24-hour format.
2021-04-01 21:23
- At the moment both Files and Folders are found, although I might be amenable to a little arm-twisting to add more features.
Input looks like this:
Output looks like this:
-Chris
Find Files Modified After The Given Date v1.00.kmmacros (8.7 KB)
Hey Folks,
Since we're on the topic of finding things – I recommend the following software:
-
EasyFind (freeware) from DEVONtechnologies.
- I like a number of their freeware items.
-
Find Any File (FAF) (shareware)
- Just about the best $6.00 USD you can spend on Mac software.
-
HoudahSpot (commercial)
- At $34.00 USD it's not cheap, but I've found it very useful for about a decade now. It's Spotlight on steroids...
When I search for things on my Mac I nearly always start out with Spotlight in the Finder.
If I don't find what I want pretty quickly I'll move on to HoudahSpot.
If I still can't find what I want I'll give Find Any File a try, since it physically searches your hard drives.
The final weapon in my arsenal is File Buddy – the 1200lb gorilla of Mac search utilities.
- The developer died and FB has been languishing at version 10.0.3 for years now. But – I just noticed someone has picked up the gauntlet, and FB 11 is under development.
With EasyFind and Find Any File around, no Mac user has an excuse for not having a good find utility on their machine(s).
If anyone else has a good recommendation please let me know.
-Chris
** Not 1 Shekel was earned by my endorsements.
Can vouch for FAF, great app