File Mover Blog

February 10, 2022

Send different on success or failure notifications based on file type

Q: Is it possible in the same moving rule to have it send different on success or failure notifications based on file type. For example I only want it to send a notification if it is a pdf file extension. Other files in the job would still copy but only notify on the pdfs. I am working on a group wide project and it would help out a lot. The PDF file extension was just an example and would be other file formats.

A: We added a new option ‘Use Pascal Script as event Precondition’ in Version v2022.2.9.0

– Open Rule Events Setup

Limagito File Mover Pascal Script Setup

– Select the Event you want to setup (in our example this is the ‘On Success’ event) > Options Tab > Enable ‘Use Pascal Script as event Precondition’

Limagito File Mover Pascal Script Use Pascal Script As Precondition

– Switch to ‘Pascal Script’ Tab and Enable Pascal Script.
– Add the following script to include only .pdf files for the ‘On Success’ event. This is just a simple example but can be extended to meet all your needs.

Begin
  // ... add your code here
  If SameText(ExtractFileExt(psFileName), '.pdf') Then
    psExitCode := 1
  Else
    psExitCode := 0;
End.

Limagito File Mover Rule Events Pascal Script

#Filetransfer

If you need any info about this ‘notifications based on file type’ option, please let us know.

Best regards,

Limagito Team

By Limagito-Team Pascal Script WIN , Share:
SEARCH