run a CLI command on a folder once dl finishes

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

run a CLI command on a folder once dl finishes Mon Jan 13, 2025 4:50 pm • by zeltak
Hi all

im trying to figure our how to run a CLI command on a folder full of files but wait until all the files in that folder are done downloading.

What happens currently is that i have an action that has an embedded bash script, but each time 1 file finishes dowloading in the folder it launches the script..


any way to use hazel to identify when there are no files downloading and only then launch the script?

thx so much

Z
zeltak
 
Posts: 7
Joined: Thu Apr 02, 2020 11:37 am

How would Hazel know that there are no more files downloading? What program is downloading the files?
Mr_Noodle
Site Admin
 
Posts: 11753
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

hi and thx for the response!

well the download program can vary between brave, safari or qbitorrent etc so sadly not always same app

i see what your saying RE hazel, was wondering if there was a way (maybe bash or AppleScript) to query a folder and see if nothing new has been written in last X minutes...by i really am not to technical so that maybe impossible :D


thx again

Z
zeltak
 
Posts: 7
Joined: Thu Apr 02, 2020 11:37 am

You can check the modification date on a folder. That folder would need to be inside the monitored folder for that to work (rules work on items in side a folder, not the folder itself).
Mr_Noodle
Site Admin
 
Posts: 11753
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:You can check the modification date on a folder. That folder would need to be inside the monitored folder for that to work (rules work on items in side a folder, not the folder itself).

thx appricate this alot!

any chance you can show an example for this? is that a new action or a condition in the action? and aslo i see only date, can i choose a time, ie not modified on the last 4 hours?

thx so much

Z
zeltak
 
Posts: 7
Joined: Thu Apr 02, 2020 11:37 am

Dates all include a time component as well.
Mr_Noodle
Site Admin
 
Posts: 11753
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support