Announcement

Collapse
No announcement yet.

Capture output of a DOS Window into AMS dynamically?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mystica
    replied
    //EDIT 2

    I know Riz produced a Download Action plugin a while ago, that grabs multiple-files at once, but there's no callback-function intergrated and it can only handle small files. Not to put any pressure on ya, to upgrade it, Riz. LOL. :lol

    There is however, a solution called Chain Downloader (produced by S0mbre) which handles multiple-files and progress-objects/stats, and which I've yet to look into in any detail. Maybe this can offer some insight ... dunno yet, as I haven't really looked.

    Leave a comment:


  • mystica
    replied
    Originally posted by madsen View Post
    Since this seems to be about download, out of curiosity, why don't you simply use the integrated HTTP.Download? It does have a callback function which you can adapt to your needs.
    Yes, am well aware already. It's beside the point, though. Just as Sakuya said, there's a lot that can be done via command-line that HTTP.Download can't ... least of all is that it'll lock up with multiple downloads.

    Here, if you can get this example to download multiple-files (with progress-meters) via HTTP.Download, then I'll stop looking at command-line solutions:

    //EDIT
    Actually, I probably won't stop looking, LOL. But you get my point, yeh?
    Last edited by mystica; 06-02-2010, 05:01 AM.

    Leave a comment:


  • Sakuya
    replied
    Originally posted by madsen View Post
    Since this seems to be about download, out of curiosity, why don't you simply use the integrated HTTP.Download? It does have a callback function which you can adapt to your needs.
    Wget offers a lot more functionality than HTTP.Download does, such as setting of cookies and user-agent and if we find a thread-safe way it won't block the application either. :yes

    Leave a comment:


  • madsen
    replied
    Since this seems to be about download, out of curiosity, why don't you simply use the integrated HTTP.Download? It does have a callback function which you can adapt to your needs.

    Leave a comment:


  • mystica
    replied
    Hmmm ... started out with a simple enough question. Now my brain is hurting.

    Leave a comment:


  • RizlaUK
    replied
    don't you just love threaded functions :yes

    Leave a comment:


  • Imagine Programming
    replied
    Originally posted by madsen View Post
    @Bas: have you actually achieved to capture such program's output as well or just the typical ones?
    Yes, it was a PB written dll that reads the output of an application, console output.
    I could, as said before, write a plugin that would run the application in a new thread reading
    all it's data back to AMS via an user specified callback function.

    Leave a comment:


  • Imagine Programming
    replied
    Originally posted by RizlaUK View Post
    i hope your doing that thing for me too!
    Oh you're funny haha XD

    Leave a comment:


  • madsen
    replied
    It works fine outside AMS, however when in AMS, trying to read the output file (which is being constantly updated by wget) seems to produce an "cannot open text file" error, perhaps AMS cannot open files in use yet I can open it just fine by other means. I have verified the progressive updating of the file though an outside program.

    Here is what I got so far:

    Code:
    --On a button
    File.Run("wget http://www.somewebsite.com > out.txt 2>&1", "", "", SW_HIDE, false);
    Page.StartTimer(100);
    Code:
    --On Timer
    pipe = TextFile.ReadToString("out.txt");
    Input.SetText("Input1", pipe);
    Note: Once wget finishes, the file gets displayed so we're not having a path problem either.

    Hope this is enough to get you started. Basically this is of utmost interest for you: 2>&1 (not a misspelling, see link)

    Leave a comment:


  • Sakuya
    replied
    Originally posted by madsen View Post
    I've done it! Will post an example shortly and you take it from there
    Okay, well..

    Leave a comment:


  • madsen
    replied
    I've done it! Will post an example shortly and you take it from there

    Leave a comment:


  • mystica
    replied
    Originally posted by madsen View Post
    ... @mystica: your intention is to use wget "per se" or it was just an example?
    Just an example. Wget, Curl, Sed ... doesn't matter. Any command-line utility that can download via HTTP/HTTPS and display some kind of progress-stats is fine. My intention is to capture the download progress-stats as variables in AMS, so a custom progress-meter can then be built and displayed.

    Leave a comment:


  • madsen
    replied
    I have made some tests earlier and seems that programs like wget keep the "focus" on their own thus not being able to read their output (like when it downloads).

    I successfully read the output of other console apps (as it's being written) that are not "selfish"

    @Bas: have you actually achieved to capture such program's output as well or just the typical ones?

    @mystica: your intention is to use wget "per se" or it was just an example?

    Leave a comment:


  • RizlaUK
    replied
    I looked everywhere and I just couldn't find it!
    look harder

    and a fun job for a good friend
    i hope your doing that thing for me too!

    Leave a comment:


  • Sakuya
    replied
    Originally posted by Imagine Programming View Post
    Oi sakuya, I made you a dll once, you lost it! It was writing the file remember?

    Perhaps I'll write a plugin later once I've fixed my ISP issues and a fun job for a good friend :yes
    Yeah, I know.. :(

    I looked everywhere and I just couldn't find it! D:

    Leave a comment:

Working...
X