Entering text into a form from a txt file.... text is truncated?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
diamondrail
Junior Coder
Posts: 20
Joined: Wed Jul 31, 2019 9:38 am

Entering text into a form from a txt file.... text is truncated?

Post by diamondrail » Sun Sep 29, 2019 9:15 pm

I have used the "sendtext" function to add text to a field on a website, however, I noticed the text file is not completely added despite the web form having space. Only 5 % of the text gets added. I even added a significant delay to ensure that the text function had sufficient time to input the text...
any help is appreciated.

Amount of text in file: approx. 100 words
type of file on desktop: txt file.

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Entering text into a form from a txt file.... text is truncated?

Post by Grovkillen » Mon Sep 30, 2019 4:15 am

Have you added delay inn the send text command (I.e. key delay)?
Let>ME=%Script%

Running: 15.0.24
version history

diamondrail
Junior Coder
Posts: 20
Joined: Wed Jul 31, 2019 9:38 am

Re: Entering text into a form from a txt file.... text is truncated?

Post by diamondrail » Mon Sep 30, 2019 5:29 am

Grovkillen wrote:
Mon Sep 30, 2019 4:15 am
Have you added delay inn the send text command (I.e. key delay)?
Please elaborate. Thank you.

diamondrail
Junior Coder
Posts: 20
Joined: Wed Jul 31, 2019 9:38 am

Re: Entering text into a form from a txt file.... text is truncated?

Post by diamondrail » Mon Sep 30, 2019 5:41 am

Grovkillen wrote:
Mon Sep 30, 2019 4:15 am
Have you added delay inn the send text command (I.e. key delay)?
I figured it out and it worked.

Added the line:

Let>SK_Delay=25
before the
SendText>myText2 line

diamondrail
Junior Coder
Posts: 20
Joined: Wed Jul 31, 2019 9:38 am

Re: Entering text into a form from a txt file.... text is truncated?

Post by diamondrail » Mon Sep 30, 2019 5:42 am

SOLVED.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Entering text into a form from a txt file.... text is truncated?

Post by Dorian (MJT support) » Mon Sep 30, 2019 11:43 am

I have another workaround for you on this.

Sometimes the performance of the target app can be a real issue. I've seen apps or forms that wouldn't accept all the characters unless SK_delay was in the region of 400.

This is a problem when some web forms won't accept the usual methods of using any Macro Scheduler Native IE function, so it has to be typed text

In these cases I use PutClipboard to put the data into the the clipboard, and then use CTRL-V to paste it. This allowed me to type very long string in a fraction of a second. Of course, you still have to make the script click in the right place, unlike using the IE commands, so this is only for those instances when we need to send text.

I used Gosub to reduce repetition.

It went something like this :

Code: Select all

//Pseudo get data code
XLGetCell>XLBookHandle,SheetName,Row,Col,Result

//Put it in the clipboard
Put>Result

//Click in the desired location (use whatever method suits the scenario
MouseMove>100,100
lClick
Wait>0.1

Gosub>Paste

SRT>Paste
Press CTRL
Wait>0.05
Send>V
Wait>0.05
Release CTRL
END>Paste
*All "waits" in the above script can be edited or omitted. Trial and error -sometimes we need them, sometimes we don't. :)
Yes, we have a Custom Scripting Service. Message me or go here

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