Cannot cut & paste except in debug

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
davek1024

Cannot cut & paste except in debug

Post by davek1024 » Wed Nov 26, 2003 7:55 pm

I have the following text to highlight something in an IE window, copy it to the clipborad, and then paste it into a variable. When I "run" it, it never seems to put anything into the variable, but when I "debug" and perform the last line, it works fine. How come? I also put "wait>2" in a few places but I get the same result...
---
MouseMove>68,273
Ldown>
MouseMove>249,279
Lup>
Press CTRL
Send Character/Text>c
Release CTRL
GetClipBoard>capture1

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Nov 26, 2003 8:59 pm

Note: No testing done here, just some quick thoughts right now.

:?: Are you sure the front end is really working when you single step? When you do it manually, have you emptied the clipboard first? You may be using a value from an earlier process.

:idea: Check to make sure you have no trailing space on any lines, especially those with a variable name or Label name on the end.

:?: It may be that you should MouseMoveRel> instead. Positioning may not be accurate enough with MouseMove itself.

:idea: Try to use keystrokes vs. mouse. Try tabbing to specific location if possible to select text before doing CTRL-C.

:idea: Or even better for keystrokes, consider doing View Source, then Search to locate text, then use shift + arrows. CTRL-C, and close View Source window.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

davek1024

Post by davek1024 » Wed Nov 26, 2003 9:50 pm

Are you sure the front end is really working when you single step? YES
When you do it manually, have you emptied the clipboard first? YES
You may be using a value from an earlier process. NO- I AM SEEDING THE CLIPBOARD WITH A DIFFERENT VALUE AND HENCE CAN TELL THAT I AM GETTING THE VALUE FROM THE FRONT-END.

Check to make sure you have no trailing space on any lines, especially those with a variable name or Label name on the end. YES I DID AND IT ALL APPEARS FINE.

It may be that you should MouseMoveRel> instead. Positioning may not be accurate enough with MouseMove itself. I AM MAXIMIZING THE PAGE AND THE MOUSE ACTION WORKS CORRECTLY AS I GET THE VALID TEXT WHEN I SINGLE STEP THE 'GET CLIPBOARD' LINE.

Try to use keystrokes vs. mouse. Try tabbing to specific location if possible to select text before doing CTRL-C. I CANNOT AS THIS IS NOT TABBABLE TEXT IN THE WEBPAGE.

Or even better for keystrokes, consider doing View Source, then Search to locate text, then use shift + arrows. CTRL-C, and close View Source window. I CANNOT AS IT IS NOT STANDARD KEYBOARD CHARACTERS. FOR EXAMPLE 951591 EXISTS IN THE SOURCE AS
&#57&#53&#49&#53&#57&#49

Lumumba

Post by Lumumba » Wed Nov 26, 2003 10:28 pm

Any reason why you use the LDown/LUp command not as specified (with that additional char)?
.
.
Ldown>
MouseMove>249,279
Lup>
Press CTRL
.
.
.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Nov 26, 2003 11:36 pm

The following code worked OK for me:
WaitWindowOpen>mjtnet.com :: View topic - Cannot cut & paste except in debug*
SetFocus>mjtnet.com :: View topic - Cannot cut & paste except in debug*
Wait>2
MouseMove>296,259
Wait>1
Ldown>
Wait>1
MouseMove>534,331
Lup>
Wait>1
Press CTRL
Wait>1
Send Character/Text>c
Wait>1
Release CTRL
Wait>1
GetClipBoard>capture1
Initially, like you, it was not working for me. :?:

I modifed the mouse values to force an area of "copyable" text to be selected. After doing some single stepping, I added/removed WaitWindowOpen>, WaitReady>, and SetFocus>, some Wait> commands, and it worked. I have not been able to make the time yet to "do an autopsy" on the coding.

:idea: I used the Tools, View System Windows, Copy Caption as Text options to get the Widow Name. Name was very long, so I truncated it with "*".

Re:
Any reason why you use the LDown/LUp command not as specified (with that additional char)?
I also used the ">" (because of Copy/Paste), but have noted this behavior in the past. It seems like Macro Scheduler sees ">" as a command delimiter at the end of many single word commands. BUG? If yes, it certainly isn't critical. I have also noted that you can omit the ">" and commands may still work. Try some Goto> commands without the ">"

:arrow: Back to this script....now I just need to remove some lines and/or change the Wait> values until I break it again......
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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