Output to Another Program
(As of 3.0.004.05)
If the output destination is preceded by "run::
", Merge will treat the rest of the output string as a command to be executed once the entire output file has been created. So for example:
-output "run:: curl -T %t -u user:password ftp://mywebsite.com/newfile.pdf"
The above output definition would invoke the curl.exe program to send the output file (the %t value) via FTP to a website. This could just as easily be the name of an archive program or any other program or command script on your computer. All the normal $X, [fieldname], and %x substitutions are available if required.
The program that is called should exit with a return code of 0 if it succeeded. All other return values will be construed as a failure and result in an error written to the Merge logfile.
You could accomplish the same thing by directing the output to a temporary file, then using a script in the End-of-Document or End-of-Job event to invoke _run
, passing it the needed parameters. Using run::
as the output "file name" is seen as a simpler, more declarative way to accomplish those operations. You can supply any needed credentials for access to other systems and effect dynamic network connections if that is what your output distribution needs call for.