All templates
Desktop AutomationBeginner
Print Documents
Robomotion•Updated 9 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.
More desktop automation templates
See all 11 →- Add Datetime to File NamesRenames every file in a directory by appending the current date to its name. A quick way to version artefacts, snapshots, or export batches.
- Copy FilesCopies every file from a source directory into a destination, with optional overwrite. Demonstrates how to enumerate files and drive file-system operations from a subflow.
- Delete Files of Specific Size RangeScans a directory and deletes files whose size falls inside a min/max range. Useful for pruning oversized logs or clearing tiny scratch files.
- Find and Delete Empty FilesWalks a directory, locates zero-byte files, and deletes them in a single pass. Handy for cleaning up broken export folders.
- GUI Testing CalculatorDrives the Windows Calculator through native UI automation to validate arithmetic. A concrete template for end-to-end GUI testing of desktop apps.
- Open a FolderLaunches the system file explorer pointed at a given path. Minimal template demonstrating the Application.Launch node.