Win32::OLE Code needed

From: edgrsprj (edgrsprj_at_ix.netcom.com)
Date: 01/24/04


Date: Sat, 24 Jan 2004 03:42:22 GMT

It was suggested in an earlier post that I could use Win32::OLE routines to
control Windows applications instead of using Windows Script Host. I read
the Win32::OLE documentation and agree. But I but do not understand it. I
started working with Perl just this past week.

The following is an example of what I would like to do. If someone can
supply the correct Perl code then that would be appreciated. If not then I
can still do this by having Perl call subroutines written with a different
type of control program. And I can learn how to do it the correct way at
some later date.

EXAMPLE:

Open C:\example1.txt, an existing file, using notepad
Open C:\example2.txt, a new file, using notepad
Activate example1.txt
Print the word "practice1" to the screen
Save example1.txt
Activate example 2.txt
Print the word "practice2" to the screen
Save example2.txt
Close (exit) example1.txt
Close example2.txt

CONTROL CODES

Can anyone explain how control codes could be sent to example1.txt while it
is running?

For instance, if I want the cursor to move to the end of the file I would
press and hold Ctrl and then press End on the keyboard. How could Perl be
instructed to send that code to notepad?

Also, how can an Alt code be sent such as Alt F and then S (save file)?

As I said, I have another control program which I can use for those types of
things by making them subroutines which Perl can call. To enter a control
code with that program you just place a "^" before the character or word in
a "SendKey" statement. Alt is represented by a "!".

The following is the reason for trying to learn how to do all of this:

http://www.freewebz.com/eq-forecasting/90-05.html

That Web page contains quite a few data related to earthquake research. And
unfortunately there is no single program which can generate all of those
different types of data. So a variety of programs have to be run, one after
the other. I have a very slow control program which does that now. And it
works fine. But it executes just 1 instruction to perhaps as many as 100 at
the most per second depending upon the complexity of the instruction. And I
need to get a faster control program running. Perl looks like a good
choice. Additionally, I need to improve my calculation speeds (versus using
Basic). But I already know how to use Perl to do calculations. Controlling
Windows applications is a little more complicated.



Relevant Pages

  • Re: OT programming languages/ systems for advanced applications on Linux
    ... The type of applications I've been writing with Perl include system utilities, text munging, data acquisition and control, and CGI scripts. ... I've staying away from graphical user interfaces and hope to use Web 2 technologies instead. ... I prefer text files over databases for interoperability and version control reasons, although I do have ideas for using SQL for indexing and query acceleration. ...
    (Debian-User)
  • Re: disappear even in binary mode
    ... just like a Perl program would do. ... Basic only did what dozens of JCLs (job control language) of the day ... Basic was unusual in that it handled some of that on the language level, ...
    (comp.lang.perl.misc)
  • Re: perl script to binary executible
    ... > deploying it on a client machine ... You'd have better luck by writing really really bad Perl, ... and find a way to have your code running on a machine ... where *you* are the only one in control of it. ...
    (perl.beginners)
  • Who will win the battle for control of the web?
    ... Reactions from the Perl community? ... and occupying a strong position underneath the five contenders (with ... Does Perl have a stake in the battle for control of the web? ...
    (comp.lang.perl.misc)
  • Re: [OT] Perl Developers Needed for Open-Source ATC!
    ... > The project MrATC (Air Traffic Control) needs more Perl developers. ... maintenance programmers versus project complexity. ...
    (comp.lang.perl.misc)