Win32::OLE Code needed
From: edgrsprj (edgrsprj_at_ix.netcom.com)
Date: 01/24/04
- Next message: J Krugman: "Re: Module packaging conundrum"
- Previous message: edgrsprj: "Re: Window and program control questions"
- Next in thread: Ben Morrow: "Re: Win32::OLE Code needed"
- Reply: Ben Morrow: "Re: Win32::OLE Code needed"
- Reply: Bob Walton: "Re: Win32::OLE Code needed"
- Reply: Jay Tilton: "Re: Win32::OLE Code needed"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: J Krugman: "Re: Module packaging conundrum"
- Previous message: edgrsprj: "Re: Window and program control questions"
- Next in thread: Ben Morrow: "Re: Win32::OLE Code needed"
- Reply: Ben Morrow: "Re: Win32::OLE Code needed"
- Reply: Bob Walton: "Re: Win32::OLE Code needed"
- Reply: Jay Tilton: "Re: Win32::OLE Code needed"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|