Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: The Command Line/off topic.

Author: Michael Yee

Date: 16:47:49 01/22/04

Go up one level in this thread


On January 22, 2004 at 17:26:02, Russell Reagan wrote:

>On January 22, 2004 at 09:20:47, Michael Yee wrote:

[snip]

>Just to clarify, what you are talking about is (for example) sending
>text to a specific text box in an application, right?

[snip]

Yes, that's pretty much what I mean (as long as the application would let you
use tabs to navigate everywhere and/or have shortcut keys for the operations you
wanted).

For example, here's a script that steps through some moves of a game in
WinBoard, copies the FENs to the clipboard, and then pastes them into an open
text document:

<code>
WScript.Echo("Hello from WSH:JavaScript...");

WshShell = WScript.CreateObject("WScript.Shell");

for (i = 0; i < 20; i++)
{
   WshShell.AppActivate("Robert J. Fischer vs. Paul Keres");
   WScript.Sleep(20);

   WshShell.SendKeys("%(+c)")
   WScript.Sleep(20);
   WshShell.SendKeys("{RIGHT}");

   WshShell.AppActivate("notepad");
   WshShell.SendKeys("(^v){ENTER}");

   WScript.Sleep(20);
}
</code>

I've only tinkered with WSH a little, so there are probably better ways to do
this. But I thought it was pretty neat.

Michael



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.