comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: not so IDL related... Command line auto-feed
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: not so IDL related... Command line auto-feed [message #61135 is a reply to message #61127] Mon, 07 July 2008 17:24 Go to previous messageGo to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
I would first try one of the many mouse/keyboard "macro" utilities.
Something like www.autohotkey.com. I haven't used this one in
particular (and I can't remember what program I used to do something
like this in the past) but most of these allow you to create text based
scripts that drive the application. Once you work out the details you
can write a program in IDL that creates the scripts given your inputs.

Another option would be to do it in VB. I've done this successfully as
well. Something like:

Imports System.IO
Imports System.Diagnostics
Imports Microsoft.Win32

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private psInfo As System.Diagnostics.ProcessStartInfo
Private process As process

exeFile = "notepad.exe"
psInfo = New System.Diagnostics.ProcessStartInfo(exeFile)
process = System.Diagnostics.Process.Start(psInfo)

process.WaitForInputIdle(3000)
System.Windows.Forms.SendKeys.SendWait("This is a test...")
System.Windows.Forms.SendKeys.SendWait("%f")
Sleep(500)
System.Windows.Forms.SendKeys.SendWait("s")
Sleep(500)
System.Windows.Forms.SendKeys.SendWait("test.txt")
Sleep(500)
System.Windows.Forms.SendKeys.SendWait("%s")
sleep(500)


You would of course want the application to read the inputs from a text
file, start the process, send the inputs, monitor the process and then
loop when the process exits. I don't know if there is an "isRunning"
property for the System.Diagnostics.Process class. My guess is that
there is something you could use.

Good luck!

-Rick




Jean H wrote:
> Hi all,
>
> sorry for the misuse of this forum... though one of the smart here may
> be of great help!
>
> Ok, I have to process about 200 files though a program called dem2xyzn
> (for USGS DEM files). This program runs only under windows (and dos),
> and have basically no support. You start the program, then it ask for
> the name of the input file, then for the name of the output file, then
> if you are sure you want to continue etc.
>
> I want to automate all of this...
> There seems to be no way of specifying the parameters values (input,
> output) when calling the program.
>
> Is there a way to have a text being written in the current dos window?
> something that would look like, in pseudo-code:
>
> -call the program
> -write input1
> -write input2
> -write any letter to tell the prog to continue
> =start again with another set of input?
>
> I have tried to do a batch file, but the "write input1" get executed
> after the program has resumed...
>
> Any help of hints would be greatly appreciated!!!
> Jean
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: What Else!? More IDL 7 Woes.
Next Topic: Help with program speed (Recursive Merging Function)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:56:11 PDT 2025

Total time taken to generate the page: 0.00439 seconds