-
How to set Progress end notification
You don’t have to check the progress bar every time, to know that the computation is done. You can tell RC to notify you by playing a sound or writing the process result into a file. You can define it in the Application settings, section “Progress end notification”.
A very simple example is to write executed file ‘my_file.bat’ like this:
echo Process %1 has finished with result code %2 in %3 seconds. > %4
And then in the “Command-line process” call the ‘my_file.bat’ file with parameters:
C:\Users\zuduri\Desktop\my_file.bat $(processId) $(processResult) $(processDuration:d) C:\Users\zuduri\Desktop\my_results.txt
Note : Use your own paths for the files.
Results will be written into the file ‘my_results.txt’. If the process finishes correctly, processResult will be 0. You can also adjust executed file to write result only for the processes finished with an error.
You can find more info in the Help, section “Application settings”.
E-mail notification
Simple example: How to send an email from Gmail after process is finished either with „success“ or „error“.
Create file ‚my_file.bat‘ like this (in the first line enter the path to your files):
cd C:\Users\user\Desktop\
if /i “%1” NEQ “0” (
PowerShell.exe -ExecutionPolicy Bypass -file “.\email.ps1” -argument “ERROR”
) else (
PowerShell.exe -ExecutionPolicy Bypass -file “.\email.ps1” -argument “SUCCESS”
)
Create file ‚email.ps1‘ like this (change your credentials):
param($argument=“none”)
$EmailFrom = “emailFrom@gmail.com”
$EmailTo = “emailTo@gmail.com”
$Subject = “RealityCapture process”
$Body = (“Computation finished with result:”,$argument)
$SMTPServer = “smtp.gmail.com”
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“username”, “password”);
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
In the Application settings, section Progress end notification - Command line process call the ‘my_file.bat’ like this (change to your path):
C:\Users\user\Desktop\my_file.bat $(processResult)
NOTE: You might need to change your Gmail settings allowing less secure apps to access your account.
Alternatively, you can add more parameters to the message such as process ID or process duration.