Sign in to follow this  
Followers 0
dazza

Can an AutoIt exe inform another of its progress?

8 posts in this topic

I have a parent script

This runs child scripts; these are AutoIt child.exe's

Is it possible to have the child.exe passing values to the parent script as the child progresses?

For example; having the child.exe telling parent what line it is running, and having parent displaying this?

Many thanks in advance. :P

Share this post


Link to post
Share on other sites



Search or Google for: "Interprocess Communication" or "IPC"

Share this post


Link to post
Share on other sites

Yikes. This is all too tecky for me.

Ideally, some example code would be my holy grail.

:P

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

The most quick&dirty solution coming up in mind is communication through INI files. AutoIt has so nice ini functions and the files are simple and structured at the same time. The idea of file handling is also easy to grasp instead of using some weird protocol.

Both scripts just gotta know the file location and that's it :P

Edited by amokoura

Share this post


Link to post
Share on other sites

I have a parent script

This runs child scripts; these are AutoIt child.exe's

Is it possible to have the child.exe passing values to the parent script as the child progresses?

For example; having the child.exe telling parent what line it is running, and having parent displaying this?

Many thanks in advance. :P

There are various ways. If you do not like the idea of using messages then have a look at ControlSend. You could something like an edit or a label in the parent and the child can write information to it using ControlSend. It's much slower than a message and not so versatile, but it's simple.

The example you give of sending the current line number from an exe might be difficult because a compiled script cannot tell you the current line number.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Ok... on reading through the INI commands, I can't make the connection. Let me elaborate on the problem with an example:

parent script has this function:

func progress($some_text)
    msgbox(0, "progress", $some_text)
endfunc

child scripts must be .exe's (for company security reasons)

Each child has this format:

do stuff
call progress in parent
do stuff
call progress in parent

ad infinitum

How do I get this 'call progress in parent' to work?

Share this post


Link to post
Share on other sites

Hi,

why not including the other scripts as functions in the main skript?

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Ok... on reading through the INI commands, I can't make the connection. Let me elaborate on the problem with an example:

parent script has this function:

func progress($some_text)
    msgbox(0, "progress", $some_text)
endfunc

child scripts must be .exe's (for company security reasons)

Each child has this format:

do stuff
call progress in parent
do stuff
call progress in parent

ad infinitum

How do I get this 'call progress in parent' to work?

If Mega's question doesn't help then this is how my suggestion would work, but it assumes that the child exe has a window.

The parent script has this function:

func progress($some_text)
    controlsetText("child title","","Edit1",$some_text)
endfunc

Each child has and edit called $Ed1 for receiving the progress text. If you have more than one edit you need to check that the "Edit1" in the parent is correct.

do stuff
$progress = GuiCtrlRead($ed1)
do stuff
$progress = GuiCtrlRead($ed1)

It can be done the other way round of course. The parent could have an edit and write the progress to that and the child could read it with ControlGetText.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
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
Sign in to follow this  
Followers 0