File Change

studio

#1

Can we make the changes in Java Script file through UiPath? I want to change some text in JS file while running time.


#2

Did you try

Read Text File - activity

Ouput.Replace(“old text”,“new text”)

Write Text File - activity


#3

Read Text and Write Text activities supports only to Texts and docs file.
I want to do changes in .js file. can we do that?


#4

Give a try.It should work.


#5

Ok. I will try above activities for .js file. let me check.
Thanks.


#6

Hi, Read text and Write text within text file is working. And if I use replace text in .js file then its not works. shows the File format .js not supported.

I am able to read data from excel and write it into .js file. but not replace in .js.

I thing we can replace text within doc file.


#7

Don’t use Replace Text activity, it works only inside Word Application Scope.

you have to use String.Replace (of your script)

jsScript = jscript.Replace(“abc”,“xyz”)

Then do Write Text


#8

function(e){

document.getElementById(‘mapImageTextArea’).value = [365,225,430,225,430,270,375,270];

}

This is my JS code file contains some points. While running time I have to Change only some Points which are in array.


#9

If I will do write activity Then it will change all. Have to change some part in JS.


#10

Why not use inject Js activity and pass the array as parameter?

search the forum for samples.


#11

Yes. First Time running I have used the Inject JS activity. but second time I want only point should be changed at running time.

Means, First time It will inject the initial Array.then second time It will take the some changed point from excel and replace it with existing.

So, I am stuck with how to replace only points second time with existing.


#12

Why not pass the modified array every time?

arr(Array.IndexOf(arr, 225)) = 300


#13

Hi, Is the Uipath communicate between Software and Devices? Means, In Non-IT field Can we use UiPath for software and Devices interaction?