HTML data entry from txt file - wrong characters

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Tomas.Hak
Newbie
Posts: 3
Joined: Tue Jul 28, 2015 6:02 pm

HTML data entry from txt file - wrong characters

Post by Tomas.Hak » Tue Jul 28, 2015 7:49 pm

Hello guys,

I created a macro that push data do some web information system instead of me. I am getting txt files that have stable structure (eg.: first line is title), and I send those lines to some right places on the page.

I am really struggling with some characters that are in the text in this workflow. (I am getting txt files in many languages so I cannot say what come next but I believe txt files are fines)

1) read line with defective text
2) print it in message ... it looks fine
3) place text into web page ... it looks bad :(

There is demonstrating piece of code:

Code: Select all

ReadLn>test.txt,1,strLine
MessageModal>first line : %strLine%
#Mouse click somewhere in Firefox - input box
MouseMove>777,618
LClick
SendText>%strLine%

Do you have any suggestion to solve this trouble?

Thank you,
Tomas

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: HTML data entry from txt file - wrong characters

Post by Marcus Tettmar » Tue Aug 04, 2015 9:06 am

When I open your text file in Notepad I see the following:
M3 – K1 – “SM”
Which is what is showing in your Macro Scheduler Message. So it looks like Macro Scheduler is reading it correctly. I can't, however, explain why it is not showing correctly in your email.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Tomas.Hak
Newbie
Posts: 3
Joined: Tue Jul 28, 2015 6:02 pm

Re: HTML data entry from txt file - wrong characters

Post by Tomas.Hak » Fri Aug 07, 2015 5:56 pm

Thank you for your replay Marcus.

Yes, when you open it in Notepad or display it in Message it is correct, but when you try to use it in browser (i use FF) it goes wrong. I thing there is something wrong with function "Send" and "Sendtext" or I use them in bad way I am not sure.

Anyway can you try folowing modified code for other demonstration of this defect? (I eliminated browser for clarity)

Code: Select all

ReadLn>c:\Users\thakx\Desktop\test.txt,1,strLine

Run>Notepad.exe
WaitWindowOpen>Untitled - Notepad
SetFocus>Notepad*
Send>first line Send: %strLine%
Send>Enter
SendText>first line SendText: %strLine%
Send>Enter
MessageModal>first line : %strLine%
note: the content of test file is just fragment of longer text. I deleted all no important, but it is my source data that I cannot manipulate before processing

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: HTML data entry from txt file - wrong characters

Post by Marcus Tettmar » Mon Aug 10, 2015 2:58 pm

Hi,

Yes, I see the problem. Not sure why but Send (SendText is the same - just an alias) is unable to process those quote characters.

This works:

Code: Select all

ReadLn>C:\Users\Marcus\Downloads\test.txt,1,strLine
//Run>Notepad.exe
//WaitWindowOpen>Untitled - Notepad
SetFocus>Notepad*
PutClipboard>strLine
Press CTRL
Send>v
Release CTRL
Press Enter
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Tomas.Hak
Newbie
Posts: 3
Joined: Tue Jul 28, 2015 6:02 pm

Re: HTML data entry from txt file - wrong characters

Post by Tomas.Hak » Mon Aug 10, 2015 10:23 pm

Thank you for the solution.

Anyway, if you is going to investigate more in this defect, there I can cooperate. I believe it is worth for you put it into your defect system, because some information is lost and changed inside MacroScheduler. I guess it has something to do how you process Unicode strings ... hard to say

Plese keep us informed when you have update.

I can probably find few more characters then ware in demonstrated example, if you are interested.


Thank you,
Tomas

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts