No Window Name available

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

obfusc88
Pro Scripter
Posts: 89
Joined: Wed Mar 14, 2007 6:22 pm

Post by obfusc88 » Tue Aug 30, 2011 5:53 pm

Only luck is bad luck.

Press>ENTER did not work
Using /YY did not work
Using /WV0 did not work.

The java script sounds interesting, again, I think that is what I need, something to call from another program to pass the AnyKey value.

Thanks for all the suggestions.

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Tue Aug 30, 2011 10:09 pm

Is your OS Windows 7?
Does your version of Macro Scheduler support RP_ADMIN?
If yes, try:
Let>RP_ADMIN=1
Run Program>C:\Program Files\XXcopy\xxcopy.exe Q:\*\* T:\Snap\ /CR8 /BU /PB /FF /CK0 /OAQ:\Data\Backups\Logs\20110824Msg.log /FoQ:\Data\Backups\Logs\20110824Files.log /FMSDTZAL /EXQ:\Data\Backups\Xxcopy\ExcludeList.txt

obfusc88
Pro Scripter
Posts: 89
Joined: Wed Mar 14, 2007 6:22 pm

Post by obfusc88 » Wed Aug 31, 2011 5:20 pm

Thanks for that suggestion, but cannot try for another day. Suspect it will not have an effect. It seems that this OS check is looking at the dates of the OS kernel and a user dll file. If later than compiled date of xxcopy then warning is triggered, and real xxcopy is not run yet.

Will let you know the results.....

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Wed Aug 31, 2011 9:51 pm

Please try:
Use Macro Scheduler Editor to find out the mouse location inside the C:\Windows\System32\cmd.exe dialog window, say, 900,500.

WaitScreenImage>c:\Temp\cmd.bmp
Wait>1
MouseMove>900,500
LClick
Press ENTER

obfusc88
Pro Scripter
Posts: 89
Joined: Wed Mar 14, 2007 6:22 pm

Post by obfusc88 » Thu Sep 01, 2011 12:32 am

Hmmm, that sounds too obvious to work! :roll:

Again, won't be able to try these latest suggestions for at least another day, but I think I will try this one first. The Lclick should set the focus on the window, then Press>Enter will do the trick.

Thanks again for the suggestion.

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Thu Sep 01, 2011 1:34 am

Thanks for your feedback.
If it fails again, don't worry and don't settle. Members here will help you out.

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 » Fri Sep 02, 2011 3:44 am

I found the java script I had remembered, and did get to try it out. I don't recall where I got it from (RexCopy ?), but the original author's name is included in my script. Seems to be working, but it does come up with a message that XXCOPY is not running even though the window is open. When I close that error window, it seems to continue to work OK.

Here is the Macro Scheduler script:

Code: Select all

SRT>TestOne
Let>RP_WINDOWMODE=1
Run Program>C:\Program Files\XXcopy\xxcopy.exe M:\*\* T:\98\C /CR8 /BU /PB /FF /WV0 /CK0 /OAM:\Data\Backups\Logs\20110831Msg.log /FoM:\Data\Backups\Logs\20110831Files.log /FMSDTZAL /EXM:\Data\Backups\Xxcopy\ExcludeList.txt
Wait>20
ChangeDirectory>Q:\Masters\Xxcopy\Rexcopy
Run Program>wscript SendKeys.js xxcopy ~
Wait>10
WaitWindowOpen>Progress - XXCOPY*
WaitWindowClosed>Progress - XXCOPY*
Let>RP_WINDOWMODE=0
End>TestOne
When I ran this test, the SendKeys.js script was in the Rexcopy folder on Drive Q as noted in the script. I also added some lines so I could see the Progress Bar for quicker feedback about the running status.

Here is the SendKeys.js script:

Code: Select all

//SendKeys.js

// Original Script by Urs Eberle, 2008 public domain
// Modified Script by Bob Hansen, 2009 public domain
// This script will send keyboard keys  to a running program. 
// Two arguments are needed: 
// 	The windows title of the program and the key(s) to be sent
// The script will wait for 500 ms before the key is sent in order to give the program
//  The time to load if it is started together with the script or immediately after. 
 
// Example1: SendKeys.js calculator 100
// 	will enter the figure 100 into the windows calculator (which must be running).
// Example2: SendKeys.js xxcopy ~
// 	will enter the "~" character into the xxcopy window (which must be running).
//	The tilde character "~" acts as an Enter key.
// For the special keys syntax consult the 'Microsoft Windows Script //Technologies' manual.

var WshShell = new ActiveXObject("WScript.Shell");
var objArgs = WScript.Arguments;
if (objArgs.length < 2) 
{	WScript.Echo("This script must be run with two arguments!");
	WScript.Quit();
}
// WScript.Sleep(500);  // delete this if the program has been started before the script
if (WshShell.AppActivate(objArgs(0)) == true)
{	WScript.Sleep(500);
	WshShell.SendKeys (objArgs(1));
}
else WScript.Echo("Program '"+objArgs(0)+"' is not running!");
This could be modified to remove the last "else" line so you don't get the message about XXCOPY not running. I don't recall that message coming up when I first used this a few years ago, and it may be related to your original comments about a ConsoleWindowClass in Windows7. I have no knowledge about those Microsoft objects, so I can't offer any help about that. But this seems to work. You can modify the times of 500 as you need the delays for your own use.

This java script is also a generic script, it can be used for any program, not just for Macro Scheduler. My original use with Macro Scheduler was in a batch file on some XP systems. You may also want to look at RexCopy, it is a GUI interface for XXCopy so you don't need to keep looking all of the switches. I don't use RexCopy, I am old school and prefer to select the codes myself. See more here: http://rexcopy.diorama.ch/


I would also try out the last suggestion from armsys about using MouseMove/LClick/Press Enter. That looks good to me also.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Sat Sep 03, 2011 2:20 am

Hi Bob,
It's nice to see you again years later.
Thanks for offering a elaborate and laborious java script.
Thanks for taking time to try out my simple script.

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 » Sun Sep 04, 2011 2:36 pm

Hi Armsys.

I was alerted to this item and was asked to consider providing some input. I am still distracted right now, and will probably disappear again once we have this item fixed.

If my memory is correct, I believe you also took a long leave of absence some years ago. Glad to see you are still here with your help.
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