Wait for File to be generated

Hi,

I want Xmodules to watch a folder until a file is generated from another program(Video Encoder software) and then execute the rest of the macro.

what is the function for that?

XRunAndWait | checkforfile.ps1

=> Create a Powershell, Python (or other language) file that checks if file exist then continue with the code. Then the scripts ends, and returns control to XRunAndWait.

In Powershell it would be:

While (!(Test-Path C:\pdf\file.pdf -ErrorAction SilentlyContinue))
{
  # endless loop, when the file will be there, it will continue
}