;; enable log files LOG "commercehub.log" TRACELOG "commercehub_trace.log ;; local download destination folder WORKINGDIR "C:\Users\Public\Orders\ftp_downloads" IFERROR RETURN ;; connect to commerce hub FTP managed site FTPLOGON "ftp1.commercehub.com" IFERROR RETURN ;; CommerceHub will provide actual directory you should use FTPCD "company/outgoing/orders" IFERROR RETURN ;; Download new orders. CommerceHub will delete them for you RCVFILE "*.neworders" IFERROR RETURN :loop ;; find name of next PGP file downloaded GETNEXTFILE "*.neworders" IFERROR RETURN $ERROR_SUCCESS SETREPLACE NewFileName = %nextfile ".neworders" ".xml" ;; decrypt PGP file with NewFileName as output file name PGPDECRYPT %nextfile NewFileName IFERROR GOTO move_to_error MOVE NewFileName "C:\Users\Public\Orders" ;; remove downloaded PGP file DELETE %sitefile GOTO loop :move_to_error ;; couldn't decrypt file MOVE %nextfile "C:\Users\Public\Orders\ftp_downloads\errors" GOTO loop