Printing and saving a demo message in Notepad

Hi everyone,
I have created a small project, in which a Notepad is opened and a specified text is printed and later saved.
In this i have created manually(without using recorder). But there is an problem it seems, i have specified to press save button but the root is actually not able to do that.
The same i have created using desktop recording, which is working fine. I have compared both of them. Even the selectors are same in the case of desktop recording and manual one but don’t understand where the problem is??
Help me out!!! I am sharing the file which i have created.
Note*** the file contains two tabs ,the tab named main is manually created one and the tab named sequence is desktop recorded.


project.json (693 Bytes)

@murali.s,

I hope, you know the activities available to write a text file instead of doing all this you mentioned. Why don’t you save the file using that activities?

Coming to the file attached, project.json is not enough to open the workflow. You need to attach the corresponding xaml file

@HareeshMR,
Yes i am aware of the ‘write text file’ activity, but i am a starter and just practising, just want to know whats the error is compared to recorded one? this is my first trial of a project.
I have added the Xaml Files also:
project.json (753 Bytes) Main.xaml (12.8 KB) Sequence Trial.xaml (11.6 KB)

@murali.s,

The issue is , you are using close application to close notepad, so it will close the application and then executes the next steps. So, instead of close application, try using the click on the cross to close so that it will click on the close window and executes the next steps.

Great thing i learnt from you today :slight_smile:

@HareeshMR,
Ya that’s correct…Thank you for your precious time. I too learnt a new thing today:+1:

@HareeshMR ,
can you tell me how can i dynamically update the file name while saving. For example the first file should be “demo1”, next one should be “demo2”, next “demo3” and so onn…

Use path exists activity…

Create a integer variable and assign value as 1… Then in for loop, use path exists activity as “demo” + count.tostring variable, if path exists, then increase the variable value by 1. Again check until the path does not exists.

So you can use that string as file name

what should be the condition in for loop?
And i am placing this foor loop in the attach window’ notepad.exe save as’
created a varible named ‘variable1’.

For each won’t work here, sorry for that, we need to use do while loop .Here is the sample workflow

Main.xaml (16.4 KB)

hi @HareeshMR, can you pls breif the “do while loop” in the above shared file(Main.xaml). I am not sure, the way i am thinking is right or wrong?

Notepad.zip (3.3 KB)

Here is the exact workflow. I just gave the file for your understanding. Now the workflow is in sequential order.

Do while is checking :

  1. It will format the file name as demo1 for first time, demo2 for second time and so on…
  2. If demo1 exists, the loop again returns to do and increment the file name as demo2 …
  3. If file doesn’t exist, it will save the file as the file name.
2 Likes

@murali.s,

Still any doubts? Let me know in case of any :slight_smile:

@HareeshMR,
First of all, I have a file saved with name Demo1, on my desktop.
Before the DoWhile loop , i can see you have assigned count as 1 & PathExist = False, this is fine.
then ,in the Dowhile Loop, you have incremented the count value by 1 and stored it in count, this is also fine

In the next step path exists You have specified path as “D:\UiPath\notepad automation\Demo” + count.ToString + “.txt” , for which the path exists checks if there is any file available or not (In this, My doubt is (1). the path which u specified doesn’t have any file and even if i change the path it is not showing any effect.)

In the if condition if the pathexsists is false it should create a new demo file with name as demo2, right? (My doubt here is (2). In the previous step we have updated the count value by 1 so it should be demo2, but even the demo 2 file is not getting saved in the specified location(even after me creating a new folder in specified location )

and one more thing as we are incrementing the count value the pathexists sholuld always be false that means new files with names as demo 2, demo3, etc should continue but this is not happening. and the file should get saved in D drive, right? even this is not happening.

pls correct me if i mis-understood
First of all, I have a file saved with name Demo1, on my desktop.
Below are the responses i am getting when i run the program file shared by you.


1 Like

Everything is correct bro. What you understand is also correct.

First of all, I would like to clear you one thing.

In the first file which you are referring to , I have used the do while loop after saving the file because, I hope you will understand the flow and create your own workflow using the same. But you just ran the same. That’s where all the confusion starts.

for Doubts…

  1. The path I gave is in my local. So you have to replace the path with yours
  2. This is due to the above explanation.

If you use the recent workflow i attached today, you will clearly understand the flow.

The recent workflow I attached has the activities in sequence and if you run that, your filename will be changed automatically. @murali.s

@HareeshMR
Thanks for the help, but i did not receive your recent work flow. and btw i will create my own workflow and try analysing it. Thanks once again!!!:grinning:

1 Like

Here it is, You can check this …

Better to do on your own bro :wink:

:rofl::rofl:

@HareeshMR
Don’t mind me asking the last question. can you tell what are the opportunities for freshers for Uipath

@murali.s,
No problem, Contact me at any time or even you can message me directly :slight_smile:

And I’m learning UiPath from last 8 months and I find many oppurtunities for a certified RPA developer. So, we need to complete the academy exercises and RPA certification as early as possible.

Here is the certification exam URL : http://certificate.uipath.com/

Team UiPath gave the certification with free of cost till December ending, try to complete it ASAP and prepare resume with the logo RPA certified :wink:.

You will have many out there …

Cheers and All the best @murali.s … happy automation

Thank You so much @HareeshMR, you have given a new boost to my dreams, I will complete the certification as well!!! Yo were so helpful, Thank you once again!!!