Jump to content

Two newbie question


Recommended Posts

I need to know a couple of things becausse I need to create a script I don't know if can be done with AutoIT. The question is, can AutoIT take as a string the output of a command line program ?? Another question is if AutoIT can output a string, I mean execute an AutoIT Script that outputs a string that can be taken from another program ??

Thanx :ph34r:

Greetings,

- Alandor -

Link to comment
Share on other sites

I'm not clear on what you're looking for, but if you download autoit and look in the helpfile, there's some stuff to start with:

the $cmdline variable can be used to pass options from the command line, run or shortcut arguments.

as to the others, I guess it depends on how the other program is producing that output.

perhaps if you gave some more specific examples of what you're trying to do?

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

AutoIt cannot, currently, pipe input or ouput to or from console programs. However, AutoIt can read and write from text files.

So you might need to redirect the output of the command-line program to a file:

; example
Run(@Comspec & "/c dir > C:\fileListing.txt")
FileReadLine("C:\fileListing", .......
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

Thanx for your answers :ph34r: Cyberslug, yeah, I was not sure If it could be possible. That was the reason to ask this. But I see there is no way yet then. I was thinking in redirect the output to a file, but It is not a way I like, but well, if it is the only one..... The problem is that I can do that with the run command, but if AutoIT doesn't support output of strings I can't use it with Samurize. Well, I will do what I can with autoit and I will look with other way to do the rest.

Thanx again for your help. :(

Greetings,

- Alandor -

Link to comment
Share on other sites

The problem is that I can do that with the run command, but if AutoIT doesn't support output of strings I can't use it with Samurize.

Anything that gives you command line output when you run it can be dumped to a file. For example, open a command prompt to any directory, and type this:

dir > directory.txt

That will dump the output of the dir command into a new textfile called directory.txt for you to view. You run that with the Run or RunWait AutoIt command, and then read the output text file into your script to deal with it.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Yeah, I know that. That is the first thing I wanted to know if could be done directly without using redirection. The real problem is the second question I had, becausse AutoIT doesn't have a stdout (I mean a command line output).

Link to comment
Share on other sites

well, it is on the todo list... so maybe one of the magical programers will make it work one of these days...

Replace magical with lazy. I don't think any one of us has spent any more than a couple minutes on the entire idea, because the couple minutes I spent looking at actual code wasn't all that difficult.
Link to comment
Share on other sites

emmanuel :ph34r: I hope that too :(

Valik: I don't know the AutoIT programers, but I am interested in a lot of things, But I admit I am a very lazy guy. I many times tried to keep working on many projects, but I am too lazy and too interested in too many times (add to this my real life, job, etc). And I understand completely if this project is stopped in any moment, or if it advances slowly. The programmers are in their complete right to do nothing, too much they have done already. Really lot more that almost all people (including me). And if it is not too much, I don't want any kind of flame in this post. Ok ??

Greetings,

- Alandor -

Link to comment
Share on other sites

huh?  what?  sorry, was licking toads.

so, you mean it looks too easy to bother implimenting?

Based on looking at something in SciTE which does similar, it looks like something that is easy to do (Only a couple hundred lines of code, if I remember). But actually motivating oneself to study what's in SciTE and/or do a bit of research into the subject is another thing entirely.
Link to comment
Share on other sites

ah, right, I understand, it'll take one of the coders needing it in something they're building for it to happen... that's totally reasonable.

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...