All templates
Desktop AutomationBeginner
Send Text to Notepad
Robomotion•Updated 11 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 17 →- Every customer from a CSVThe Windows Recorder's customer task run for every row of a CSV file, each typed value replaced by the row's field, with a Catch that logs a row the app will not take and goes on with the next.
- Putting it togetherOne flow over three systems. Headless Chrome reads today's web orders from Acme ERP Web, the finance system is asked about each customer over Remote Desktop, and the orders with nothing overdue are entered into Acme ERP for Windows, line by line, with a report at the end.
- Reading from a Java applicationA flow that signs in to Acme ERP (Java Edition), reads a customer's credit limit and the fasteners in the product table, works out how many boxes of each the limit covers, and writes the answer to a CSV file.
- Reading over Remote DesktopA flow that logs on to Acme ERP over Remote Desktop, reads the outstanding and overdue totals off the Invoices screen with OCR, each anchored to its label, and writes the overdue share to a CSV file.
- Slow sessionsA flow recorded on a good Remote Desktop session that logs on and updates a customer's email, phone and notes in Acme ERP, and still gets every value right on a slow session that loses keystrokes.
- Windows dialogs and gridsA flow that signs in to Acme ERP for Windows, waits for its orders grid, reads it with Get Table Data, exports the orders on hold through the Save As dialog, and closes the app answering its "Save changes?" question.