I have created a click to note pad automation which upon click will open an existing file, write to the file, and close to file. However, I would like to modify this to upon click append the already existing notepad file which is already open on my screen, write to the file while it is open on the screen where I can see the action taking place and not close the file so I can continue to use the notes in notepad instantly. I want to append an existing file that is already open in real time without needing reopen the file to see the modifications have taken place.
Honestly, this is best done in C# code (unless you need to watch it happen). I would search for "C# append text to a file" and get some suggestions there. If you want to use Pega Robotics to open notepad and treat it like any other application, then I am not sure what you are having an issue with. Your automation should do the following;
Notepad_Start - No inputs - Starts notepad if it is not running already, and if it is, then do nothing.
Notepad_Write - Input - string textToWrite - Calls Notepad_Start, grabs the text of the textbox, uses a stringUtils component to concatenate that with the textToWrite input and places the result back into the textbox.
Notepad_Close - No inputs - Closes and saves notepad. Called on-demand.
Currently I have interrogated specific fields within a web application. When the user clicks on these fields the data is appended to the notepad file using System.IO.File AppendAllText method. It works as intended, except for one catch, I need it to copy the data into the notepad file when the file is already open and I need to be able to see/watch the data being appended. The automation is being used as an interactive scratch pad. Instead of repetitively copying/pasting into my notepad "scratch pad" for other uses simply clicking will complete the action for me. As soon as the click happens I need to be able to quickly access the notepad file and content inside without needing reopen the file to see results. The System.IO.File AppendAllText method "in the background" opens the file-> writes the the file -> closes the file. In order to see any results I have to go and reopen the file. If the notepad file is already open it still writes to the file, but I can not see the results until I reopen the file. I need to be able to actively see and use the data I copied over by clicking.
I was banking on not having to go that route I thought I could get away with just using a file method. I will move on to the next route. So far, I have created a windows application for notepad. I interrogated the blank txtBox within the notepad. I do not know how to send the data I was originally sending to the System.IO.File AppendAllText method to the interrogated notepad windows application.