All templates
Desktop AutomationIntermediate
Print Current Week's Calendar
Robomotion•Updated 9 months ago

Overview
Generates an HTML page for the current week and sends it to the default printer. Useful for team dashboards or physical planning boards.
Print Current Week's Calendar
Desktop users usually have daily routines, such as printing their weekly calendar, that helps them keep themselves productive and organized. Create desktop flows that automate these repetitive tasks and make your workweek easier.
What Print Current Week's Calendar can do
- Build Paths (
Core.Programming.Function) — setsmsg.desktop_folderto<$Home$>\Desktopandmsg.image_pathto<desktop>\calendar.jpg. - Launch Outlook (
Core.Process.StartProcess,optBackground: true) — launchesOUTLOOK.EXEfromC:\Program Files\Microsoft Office\root\Office16→msg.outlook_pid. - Wait For Outlook (
Robomotion.WindowsAutomation.WaitWindow) — selector//Window[contains(@Name,"Outlook")],optCondition: appear,optTimeout: 60. - Switch To Calendar (
Robomotion.WindowsAutomation.SendKey) — sends{Ctrl}+2to the Outlook window. - Switch To Work Week View (
Robomotion.WindowsAutomation.SendKey,continueOnError: true) — sends{Ctrl}+{Alt}+2. - Wait For Repaint (
Core.Programming.Sleep,optDuration: 2). - Capture Window (
Robomotion.WindowsAutomation.Screenshot,optFullScreen: false) — saves the Outlook window tomsg.image_path. - Build Print Args (
Core.Programming.Function) — setsmsg.print_argsto['-NoProfile', '-Command', 'Start-Process -FilePath "<image>" -Verb Print']. - Send To Printer (
Core.Process.StartProcess,optBackground: true,continueOnError: true) —inFilePath: powershell,inArguments: msg.print_args. - Wait Print Spool (
Core.Programming.Sleep,optDuration: 4), then Delete Screenshot (Core.FileSystem.Delete,continueOnError: true). - Build Kill Args + Close Outlook (
Core.Process.StartProcess→taskkill /F /IM outlook.exe,continueOnError: true), thenCore.Flow.Stop.
Behind the scenes
- The "Switch To Work Week View" step uses
continueOnError: trueso the flow still proceeds on Outlook builds whereCtrl+Alt+2is absent or unbound. - The flow intentionally prints an image of the current Outlook window (via a screenshot sent through the shell
Printverb), not a vector export of the calendar. - A 2-second sleep after the view switch gives Outlook time to repaint before
Screenshotruns; a 4-second sleep after print keeps the image on disk long enough for the spooler to read it beforeDeleteremoves it. - Outlook is closed via
taskkill /F, so unsaved items in other Outlook windows would be lost — the flow assumes Outlook was launched solely for this run.
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.