Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KEY() not working correctly?
#1
Hello,

I'm using a macro to update a text field of an application over a remote session!

I'm using the function key(). It works nice most of the time, but sometimes it fails some caracters.

For example in the following code:
Code:
Copy      Help
str mytext="This is the text i want to update in the remote application field"

key(mytext)

Sometimes it misses some caracteres and in the remote application appears:
"This is the want to update in the remote application field"
or
"This is the text i want application field"

it is not a specific caracter or a specific word, it fails randomly!

Is there another way/method/function to insert a text from a variable to an application field?
Im trying to avoid the direct copy/paste because sometimes the copy/paste option also fails between the local machine and the remote application!

Thanks,
#2
All possible ways are in the Text dialog. But with remote application probably will work only keys and paste.
Try this:

Macro Macro1575
Code:
Copy      Help
spe 500
opt slowkeys 1
str mytext="This is the text i want to update in the remote application field"
key (mytext)

Also try pasting to notepad (when notepad is in background).
#3
Hi Gintaras,

Thanks for your quick answer!

I will try your code and give some feedback asap

best regards,
#4
Hello,

It seams the problem gone! Smile At least i didnt get any new complains.

Another question:

I have a web page as the interface to get/set data to send/receive to the remote application.
First reads the data from the web page, sends it to the remote application to be processed, gets the data processed and saves it on the web page. Finally it clicks on a submit button on the web.
the problem is that sometimes, the webpage takes too long to process the data itself, and the macro routine gets the same old data again to be processed in the next iteration.

Is there any way to "pause" the macro while the webpage is being refreshed? and only copy the new data after the complete load of the page?
(Note: The submit button on the webpage returns the same webpage with new data. the form/layout is always the same!)

Thanks,
#5
To click Submit use html element functions.

Htm el=htm(... "Submit" ...)
el.Click ;;should wait


Forum Jump:


Users browsing this thread: 1 Guest(s)