on 07-24-2020 6:55 AM
Hello RPA mates,
When I copy the following multi lines of numbers from notepad, and paste them to SAP GUI Multiple Selection, it works.
1910
2210
But in the following code, I tried to set the clipboard with defined text, then manually paste them to SAP GUI after each set method, SAP GUI always gave an error, complaining the content are not numbers.
After comparing the content, clipboard.set method changed \r\n line separator to \n automatically, anyone know how to prevent this or how to solve this?
Best Regards,
Mike
var mytext = '1910\r\n2210';
var copied = ctx.clipboard.get(); //copy the above numbers first then get them
var eq = copied === mytext; //true
ctx.clipboard.set(mytext);
ctx.clipboard.set(copied);
var copied2 = ctx.clipboard.get();
var eq2 = copied2 === mytext; //false
var mytext2 = '1910\n2210';
var eq3 = copied2 === mytext2; //true
Hi,
I don't know how to prevent it but you might be able to solve this using the following piece of code :
mytext2 = mytext2.replace(/\n/g, '\r\n');
Regards,
J.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.