I am able to make it work, so the files are moved to the destination folder, but I always get this:
This only happens when 2 or more files are added to the source folder. if I only add 1, no notification
I am able to make it work, so the files are moved to the destination folder, but I always get this:
This only happens when 2 or more files are added to the source folder. if I only add 1, no notification
My guess is that this is happening because the Trigger for the Macro (when a single item is added to the destination folder) is firing more than one instance of the Macro if several files are added at exactly the same time. So, on first run, the files are moved and then on second run (which is happening at almost the same time) the Macro detects the files already exist in the destination folder so it does nothing except notify with errors. As the files are successfully moved, the notifications are annoying but not affecting what the Macro actually does.
A fix for this is to add a Semaphore Lock at the start of the Macro so that it completes its run before any other instance of it starts. In my testing this stopped the Notifications.
Move from "Downloads" to "Inbox - Global" (emoji) Semaphore Lock.kmmacros (20.8 KB)
Thank you for the extra action. That does the trick indeed here, even though I have no idea what Semaphore Lock is...?
And yes, it makes sense what you said about the macro being triggered for every single file being added, but once they are gone on the first run, it will find the same file in the destination.
Really appreciate the help!
@Zabobon
Ok so now I'm facing another issue and that is, if the file is still being copied, KM wants to move it right away and that's a problem.
I saw this article, but that's a bit more complex to me. Not sure if you understand what's happening and how that could be changed to suit my needs?
The setting "ignore incomplete files" is supposed to deal with this but is obviously not working in your case.
Out of interest why are you not using Hazel to do this? I seem to remember you use Hazel for other things? I think I have exactly the same file management task (moving downloaded files from the Downloads folder to a folder of my choosing - in my case on Dropbox) and have used Hazel to do this successfully for years now.
I too default to Hazel for this type of task now because it nearly always "just works."
Since KM is my main automation tool for its flexibility and possibilities, if I can build something using it, it's better for me, and then just rely on Hazel or any other tool only for those things that would require things that KM doesn't do or that would be too complex to build.
Yes, I use Hazel a lot too, but since this seemed to be such a simple thing to achieve, I was trying to see what I could do, but it seems that there's more to it...