Create a Static Text File

Perform various actions on Notepad

This task will open Notepad, send text to the window, copy the data to the clipboard, close Notepad and save the copied data to a file using the Clipboard() function and the Write to File action.

First a variable is created (txtvar) to hold the contents of the clipboard. In order to get data from the clipboard to the variable the Clipboard() function must be used.

Next Notepad is opened using the Run action and text is sent to the screen using the Send Keystrokes action. The task then focuses on the Notepad window, pauses, sends the keystrokes to navigate the menu to highlight all text in the window and copy it to the clipboard. Notepad will then close and the Write to file action then writes the data in the variable (clipboard data) to a file.

Task Category:

Functions (Basic)