Sign in to follow this  
Followers 0
Oliberto

sending message to an autoit.exe

7 posts in this topic

Hi all,

I just started using AutoIt and wonder if it is possible to send a command line message to an already active autoit exe.

Regards;

--Al

Share this post


Link to post
Share on other sites



AutoItWinSetTitle

Remarks

The AutoIt window is usually hidden. The purpose of changing the title is to allow other programs (or other AutoIt scripts) to interact with AutoIt.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

AutoItWinSetTitle

Thanks herewasplato. Understood, but what I'm after is a way to send an autoit executable a message (say 1 or 0) while it is already running not from AutoIt or other Window's macro/scripting applications but from a dos command line. I notice I can launch a script with parameters -- $CmdLine[1] equals... param1 etc. but can I do this with an already running exe (note that AutoIt will not be installed on the machine running these scripts). In other words can the exe "loop and listen" for incomming command line messages

The AutoIt window is usually hidden. The purpose of changing the title is to allow other programs (or other AutoIt scripts) to interact with AutoIt.

Share this post


Link to post
Share on other sites

If you are saying that you want to

start your AutoIt script

manually start a console app

have your AutoIt script receive inputs from the console app

...then I'm not sure what to suggest you try within your AutoIt script.

You might look at some of the example scripts - search for console in the titles.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

What you mention below is the mechanism I'm looking for

If you are saying that you want to

start your AutoIt script

manually start a console app

have your AutoIt script receive inputs from the console app

...then I'm not sure what to suggest you try within your AutoIt script.

You might look at some of the example scripts - search for console in the titles.

Share this post


Link to post
Share on other sites

What you mention below is the mechanism I'm looking for

You could use ControlSend or messages, but for a simple method ControlSend is easier.

When someone starts the script, which could be from the command prompt, then it checks to see if there is another instance already running. If there is then it sends the parameters to the first instance of the script then closes.


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

Cool, thanks martin -- thats what I call thinking outside the box. I think that will do just fine for what I need. I also just found the $var = EnvGet("System_Var") thing -- don't know if its usable for what I need but will research it if for nothing more than curiosity.

Thanks again.

Regards;

--Al

You could use ControlSend or messages, but for a simple method ControlSend is easier.

When someone starts the script, which could be from the command prompt, then it checks to see if there is another instance already running. If there is then it sends the parameters to the first instance of the script then closes.

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