Hi there, I'm trying to set up a macro that watches a folder for new video added to it and then renames it and puts it in the correct folder. I already have the latter half of the macro working, but the issue is I'm downloading the files into this folder (not adding) and the macro gets triggered on the incomplete file. Best way I can think of to fix the issue is to check the file size and then run the macro once it's finished DLing.
I have a pretty good work around in Hazel by having it move .mp4s into a KM watchfolder ONLY if the file size is bigger than 0, which seems to work for my main download method. When I try the same thing in KM though it doesn't work, I think because it's reading the file size more accurately than Hazel and so >0 doesn't cut it. It seems I need to know how to have it check the size until the size stops changing in order to fully do this in KM.
You can have the trigger ignore partial or changing files, so for example if a file is being downloaded or copied in to the folder, the trigger will wait until the download/copy has completed and can ignore partial files (files with extensions that are known to be “in progress” files).
Hi all, thanks for the suggestions, I didn't know about %TriggerValue% and that has just radically simplified my macro, but the problem remains that the macro is triggering before the download has completed. And yes, sorry for not showing this but I am triggering the macro by watching the folder, checking "ignore partial files" doesn't do anything.
How do I add conditions to this workflow? I would love it if it only did this with .mp4s for example. The way I used to do it is using a split path I would store the extension into a variable, but I can't get the split path function to work with the trigger value? How do I have it rename the file while preserving the original extension? You can see in the screenshot that I've just written in .mp4 but I'd rather this is flexible.
Boom, I got it. The changing files element is important, forgot about that when I created this WIP macro. In combination with the %TriggerValue% it seems to avoid the pitfalls I was experiencing before. Was also running into the issue where creating a new folder in the directory to sort it was then triggering the macro twice, so I had it disable the macro once it gathers the necessary info. For me this works really well as I don't want this running all the time in the background, I'm running it one file at a time as I DL + generate the naming I want. Thanks for all the help!
It's your macro and your design, but IMO the ~/Downloads folder should be limited to exactly that -- used ONLY to receive downloads. I'd create your "Destination Folder" somewhere outside of ~/Downloads, like ~/Documents/Videos.
One reason is that I see ~/Downloads as a temp storage location, in which everything should either be moved to another folder, or deleted. So I routinely move the contents to the Trash.
For sure, the final destination in my case is a company server so I've always been hesitant to use macros in those directories just in case the worst were to happen somehow. I just move them in batches so I have time to check them over before sharing.
Yeah I think I get why. It works for me because of the download method I'm using. Typically use 4K Video Downloader and it creates one or two .part files alongside a 0 byte .mp4. So it's either 0 bytes or the download is complete. Figured .part would be considered a "partial" file in KM, but I guess not? Still don't really get why only the longer downloads need to have the size checked, KM is pretty fast at recognizing new files added and none of these downloads are exactly instant so that seems weird to me.