All templates
Desktop AutomationBeginner
Print Documents
Robomotion•Updated 6 months ago

Overview
Iterates a folder of documents and sends each one to the default printer. A compact recipe for automating bulk print jobs.
Print Documents
Printing is an integral part of most workplaces, as hard copies of documents, receipts, and reports are often required. Robomotion enables you to disengage yourself from repetitive printing and focus on more creative and productive tasks.
What Print Documents can do
- Seed Fixtures Dir (
Core.Programming.Function) — setsmsg.fixtures_dirto$Home$/templates/desktop-automation/print-documents/fixtures. - Intro Dialog (
Core.Dialog.MessageBox,info) titledPrint documentsexplaining the flow. - Seed File List (
Core.Programming.Function) — setsmsg.files_to_printto[<fixtures_dir>/hello.txt]. - Loop via
Core.Flow.Label+Core.Programming.ForEachovermsg.files_to_print→msg.file_to_print:- Build Print Command (
Core.Programming.Function) — setsmsg.print_argsto['-NoProfile', '-Command', 'Start-Process -FilePath "<file>" -Verb Print']. - Send To Printer (
Core.Process.StartProcess,optBackground: true,continueOnError: true) —inFilePath: powershell,inArguments: msg.print_args. Core.Flow.GoToback to the loop label.
- Build Print Command (
- After the loop exits:
Core.Flow.Stop.
Behind the scenes
- Printing is delegated to Windows' shell
Printverb viaStart-Process -Verb Print, so each file is opened by its registered handler and sent to the system default printer. - The flow is intentionally fire-and-forget —
optBackground: trueandcontinueOnError: truemean one failing print won't block subsequent files, and there's no per-file confirmation or progress dialog. msg.files_to_printis hard-seeded to the bundledhello.txt; swap in a file-picker or directory listing upstream to drive real batches.