Now we will add activities to save the file and close Notepad.
- In the Activities pane, find the Press Hotkey activity and drag it into the flowchart, linking it to the Set Text activity.
- Double-click the Press Hotkey activity.
-
Select Ctrl and S to enable the
robot to save the file.
Your process now looks like this:
-
In Notepad, press Ctrl +
S.
The Windows Explorer opens.
-
Since this is a new window, you need to define it for the robot. Go up one
level in the hierarchy and add an Attach Window activity
under the first notepad window.
- Double-click the new Attach Window activity and indicate the Save as dialog box.
-
Use the Set Text activity again to specify the name of
the document, for example, MyFirstProcess.
Note: You can always change the static text or variable in the properties of the Set Text activity.
- In the Save as dialog box, indicate the file name field.
-
In the Activities pane, find the Click
Element activity and drag it into the flowchart, linking it to
the Set Text activity so that the robot can click the
Save button. Use Indicate on
Screen again.
Note: If you want to indicate something again or use our expert indicator, click on the burger menu in the upper right corner of the activity.
-
To close Notepad, you need to attach a third window,
since the title of your Notepad window has changed, and drag a Close
Window activity into the flowchart.
Your workflow now looks like this - the first screenshot shows the window level, the second one shows the third window.
-
The robot is now ready for use. In the upper left corner, click
to try it out.
-
Watch as the robot enters text into Notepad, saves the file, and closes
Notepad.
Note: If you have already saved a file with this name, the robot will stop with the error message File already exists. Be sure to delete the file before restarting the robot.