All templates
Desktop AutomationBeginner
Send Text to Notepad
Robomotion•Updated 9 months ago

Overview
Opens Notepad and types a provided string into its editor window. Demonstrates how to pair Application.Launch with keyboard automation.
Send Text to Notepad
All applications contain interface elements that allow you to provide data and run specific functions on them. Robomotion delivers various UI automation nodes that enable you to interact with these elements and perform tasks like populating text fields.
What Send Text to Notepad can do
- Launch Notepad (
Core.Process.StartProcess) —inFilePath: notepad.exe,optBackground: true→msg.notepad_pid. - Wait For Notepad (
Robomotion.WindowsAutomation.WaitWindow) — selector//Window[contains(@Name,"Notepad")],optCondition: appear,optTimeout: 30. - Maximize Notepad (
Robomotion.WindowsAutomation.SendKey,continueOnError: true) — sends{Win}+{Up}to the window. - Seed Text (
Core.Programming.Function) — setsmsg.notepad_textto a three-line greeting. - Populate Editor (
Robomotion.WindowsAutomation.SetText) — selector//Window[contains(@Name,"Notepad")]//Edit,inText: msg.notepad_text,optClearFirst: true,optEmulateTyping: false,optWaitTimeout: 30, thenCore.Flow.Stop.
Behind the scenes
- The flow does not save the file or close Notepad — the goal is purely to demonstrate UI automation text population.
Maximize Notepadruns withcontinueOnError: trueso the flow still proceeds on window managers whereWin+Upis remapped.SetTextruns withoptEmulateTyping: falseandoptClearFirst: true, so the existing buffer is replaced via the UIA value pattern rather than simulated keystrokes.- The selectors use contains-matching on the window name so both classic Notepad and Windows 11 Notepad (
Untitled - Notepad,*Untitled - Notepad) are caught.
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.