Search code examples
pythonmicrosoft-edgewindows-task-scheduler

How to execute automatically a Python script using Windows Task Scheduler whenever a file downloaded from a Browser?


I wrote a Python script that I would like to execute automatically every time I download a file. Specifically, I am looking for a solution that works seamlessly with the Edge browser on Windows. After some research, I considered using the Windows Task Scheduler to achieve this, but I'm unsure how to implement it as my searches yielded no relevant results.

Essentially, my objective is to trigger the execution of the Python script whenever a file download event occurs in the Edge browser.

Any guidance or ideas on how to accomplish this would be greatly appreciated. Thank you.

Update: To clarify further, I am trying to set up a process that monitors download events in the Edge browser. When a download occurs, I want the Python script to be automatically executed. Task Scheduler seems like a suitable tool for managing such events, which is why I considered using it. If anyone has experience or knowledge in this area, I would welcome your insights and suggestions. Thank you!


Solution

  • What you should do is to implement downloads.onChanged callback.
    With this, Edge will call your code when a file is being downloaded.
    Note that the implantation is based on javascript.