WaitScreenText causing Clipboard Copy Ctrl-C to not work

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
gtdalsanto
Pro Scripter
Posts: 51
Joined: Tue Oct 03, 2006 4:22 pm
Location: Akron, Ohio
Contact:

WaitScreenText causing Clipboard Copy Ctrl-C to not work

Post by gtdalsanto » Sun May 18, 2008 4:32 am

I seem to have found a problem that occurs after using the WaitScreenText command. Using it to find text on a web page has worked very well. However, after I have executed it, I have noticed that trying to copy text from a screen to the clipboard using the keyboard commands 'ctrl-a' (select all) followed by 'ctrl-c' (copy to clipboard) will no longer work until you close/restart macro-scheduler.

Below is a simple example where I open the mgtnet.com site, wait for the main window to appear, then I issue a ctrl-a/ctrl-c to get the contents of the screen to the clipboard. I then save this data to a variable (result1). Then I put the space character into the clipboard, which basically overwrites the screen data with a space.

I then issue the WaitScreenText command, with some text that is on the mjtnet.com sites main page, which it finds with no problem. At this point, I issue the same ctrl-a/ctrl-c command, and save the contents of the clipboard to another variable (result2). Result2 does not contain the web page as expected, but it contains the space.

Also, going to applications like notepad, and copying/pasting text within notepad, work fine. However, if you go to the mjtnet.com page, and do a ctrl-a/ctrl-c, it still will not copy this data to the clipboard. It seems as if the clipboard has been disabled for only this web page.

Below is the code I used to duplicate this problem. Is there a command to reset the clipboard for this window after I have issued the WaitScreenText? or is this just a problem with the WaitScreenText command?

Thanks for your help on this issue.


'
' Start up mjtnet.com site
'
ExecuteFile>www.mjtnet.com,
Wait>2
WaitWindowOpen>Windows Scripting*
'
' Now copy this window to clipboard - ctrl-a/ctrl-c and save in result1
'
SetFocus>Windows Scripting*
Wait>0.5
Press Ctrl
Send>a
wait>0.5
Press Ctrl
Send>c
wait>0.5
Release Ctrl
GetClipBoard>result1
'
' put a space in the clipboard to overwrite contents
'
PutClipBoard>%SPACE%
'
' Now wait for some specific text on the mjtnet.com page
'
Let>WST_TIMEOUT=2
WaitScreenText>Windows Automation and Scripting Solutions
'
' Copy window again to the clipboard - ctrl-a/ctrl-c and save in result2
'
SetFocus>Windows Scripting*
Wait>0.5
Press Ctrl
Send>a
wait>0.5
Press Ctrl
Send>c
wait>0.5
Release Ctrl
GetClipBoard>result2
'
' copy of page failed. Ctrl-a/Ctrl-c no longer work until you
' exit and restart macro scheduler
'
Gary T. DalSanto
Inventive Software Designs, LLC
[email protected]

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

Post by Marcus Tettmar » Mon May 19, 2008 6:53 am

That script worked ok for me. Result2 contained the page text at the end of the script. One small piece of info - what version of Macro Scheduler are you running? Is it the very latest - 10.1.02? If not, please download the update and try again.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

gtdalsanto
Pro Scripter
Posts: 51
Joined: Tue Oct 03, 2006 4:22 pm
Location: Akron, Ohio
Contact:

Post by gtdalsanto » Mon May 19, 2008 4:48 pm

Yes, I am using 10.1.02. I tried un-installing it, re-installing it, and I still have the same problem. I am running on Microsoft XP Pro, 2GB Ram with IE7 and all the latest patches.

If I set up a breakpoint after I try to copy the page again to result2, close the page, re-open it, then do the ctrl-a/ctrl-c, it then populates result2. However, if I perform the WaitScreenText command in between the 2 ctrl-a/ctrl-c, Result2 always has the SPACE I put in the clipboard.

I have been using MS since version 7, could there be some old dll's or registry issues that could be causing this? I have tried it on different machines...both XP pro, but one has IE6 and the other has IE7.

Is there any other information I can give you? I have cleared temp directories, etc, where I noticed that copies of ICall.dll and GetWordNT.dll were. Also, I noticed some temp files that had msrxxx.tmp. Deleting all of these did not make the problem go away.

Running out of idea's of what to try. I have not had any problems until I started using these new commands in 10.x (WaitScreenText, FindImagePos, etc).
Gary T. DalSanto
Inventive Software Designs, LLC
[email protected]

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon May 19, 2008 4:56 pm

One thing I noticed is you have no "release ctrl" after the "ctrl a" lines. Could that be causing a problem?

Otherwise as-is it works fine for me too.

Edit: Also, I'm using FireFox 2.0.0.14

gtdalsanto
Pro Scripter
Posts: 51
Joined: Tue Oct 03, 2006 4:22 pm
Location: Akron, Ohio
Contact:

Post by gtdalsanto » Mon May 19, 2008 5:22 pm

I added the release, and added some wait's between them, and still get the same problem.

I then changed the script to output Result2 to a messagemodal box. I compiled it, and ran it on another machine, and got the same results. Result2 is only a space, where Result1 prior to the WaitScreenText has the window contents. Also, the variable that WaitScreenText uses for its results (RES), has the screen contents of the window in focus.

I think it has to be something on my machine that is causing this. I think I am going to try the latest demo (uninstall what I have, and load the latest demo/trial). I am using the latest, but possibly I have a corrupt copy?

Any suggestions in solving this problem would be appreciated.

Thanks.
Gary T. DalSanto
Inventive Software Designs, LLC
[email protected]

gtdalsanto
Pro Scripter
Posts: 51
Joined: Tue Oct 03, 2006 4:22 pm
Location: Akron, Ohio
Contact:

Post by gtdalsanto » Mon May 19, 2008 5:41 pm

Well, my last item...loading the free trial and executing the script corrected all my issues. I ended up downloading 10.1.15 (released today) and it corrects my issue also. All I can think of is possibly there was an issue in 10.1.02, or the copy I had was corrupt. Either way, It works fine...

Thanks everyone for the help tracking this down.
Gary T. DalSanto
Inventive Software Designs, LLC
[email protected]

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon May 19, 2008 5:42 pm

I added some WaitClipboards and rearranged the Press ctrl and release ctrl lines and their waits. Also added some modal messages. You should see three messages. One with the web page info, the second should be blank and the third should contain the web page info again.

Code: Select all

ExecuteFile>www.mjtnet.com,
WaitWindowOpen>Windows Scripting*
Wait>2

' Now copy this window to clipboard - ctrl-a/ctrl-c and save in result1

SetFocus>Windows Scripting*
Wait>0.5
Press Ctrl
Send>a
Release Ctrl
wait>0.5
Press Ctrl
Send>c
Release Ctrl
wait>0.5
WaitClipBoard
Wait>0.5
GetClipBoard>result1

MDL>result1

' put a space in the clipboard to overwrite contents

PutClipBoard>%SPACE%

WaitClipBoard
Wait>0.5
GetClipBoard>blank

MDL>blank

' Now wait for some specific text on the mjtnet.com page

Let>WST_TIMEOUT=2
WaitScreenText>Windows Automation and Scripting Solutions

' Copy window again to the clipboard - ctrl-a/ctrl-c and save in result2

SetFocus>Windows Scripting*
Wait>0.5
Press Ctrl
Send>a
Release Ctrl
wait>0.5
Press Ctrl
Send>c
Release Ctrl
wait>0.5

GetClipBoard>result2
WaitClipBoard
Wait>0.5
mdl>result2

gtdalsanto
Pro Scripter
Posts: 51
Joined: Tue Oct 03, 2006 4:22 pm
Location: Akron, Ohio
Contact:

Post by gtdalsanto » Mon May 19, 2008 5:46 pm

thanks JRL. My problems went away with the new release (10.1.15).

All is well again.
Gary T. DalSanto
Inventive Software Designs, LLC
[email protected]

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