![]() ![]() Let downloadsFolderURL = homeURL.appendingPathComponent("Downloads") Let homeURL = fd.homeDirectoryForCurrentUser Note that the space after the last ‘d’ is needed to avoid also pulling out the kMDItemDateAdded_Ranking field.įor the even more curious, my script for this is in Swift: import Foundation Which you can parse with the tool of your choice, such as awk, and write a shell script or something in KM to find the last date. Which will give you something that looks like: I can do this programmatically, so the problem is ‘solved,’ but I wonder if I’m being stupid and missing something in KM that eliminates the need for custom code.įor the curious, you can get the date last added metadata from the shell using mdls: (Hazel can access this property, but is not the right tool here as I don’t want files automatically moved.) I am uncertain how to access this directly in KM. MacOS keeps a separate date, a date added properly, which is actually Spotlight metadata and not filesystem metadata, which is the date the file was added to the folder, and that is the proper date to use for this purpose. That is NOT the latest creation or modification date. The part I don’t see easily doable in KM is finding the last added file. I would probably set it up so that if the macro is trigged with the ⌥ key it would pop up a chooser dialog to allow me to move the file to another destination as well. Therefore, it would be convenient to have a KM macro that I could trigger with a key combination that would move the last added file in the Downloads folder to the _Inbox for sorting. Many of them are eventually sent to Trash, so I don’t want to make the _Inbox the default download location. However, I do have a significant set of files that are downloaded in Safari, which wind up in my Downloads folder. Files usually wind up in there by being dragged from email attachments, directly scanned in via ScanSnap, or dumped there after creation on the Desktop. Most of the sorting is done with an extensive set of Hazel rules. I have an inbox folder, conveniently named _Inbox (the underscore so that it will sort to the top of a Finder window) where pretty much every file will wind up for sorting to its final destination. I would like to be able to find the last file added to my Downloads folder. Short version: Is there an easy way in Keyboard Maestro to find the last file added to a given folder? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |