Sign in to follow this  
Followers 0
Reeya

Query

6 posts in this topic

Is there any way to call a function from outside the script using auotIT ?

Share this post


Link to post
Share on other sites



Looks like you're after inter-process communication, which is when 2 or more programs are exchanging information. You can use this information exchange to call a function.

Someone made a library to communicate between scripts that is very much like we use e-mail. This is easy since you don't have to learn a new concept. You can find it here:

It might be a little advanced for a first try, but you can always come back here with a broken script that you have been trying to get to work.

Share this post


Link to post
Share on other sites

Hi,

Would like to have more than one functions in a single script (assume X.au3) and want to call each of those functions separately from another script say Y.au3...

Share this post


Link to post
Share on other sites

The simplest case I can think of here is that Y.au3 starts X.au3 several times with command line parameters. Your Y.au3 will look something like (psuedo code alert):

Start x.au3 /command1

Start x.au3 /command2

Start x.au3 /command3

And X.au3 will receive this string /command1, command2, command3 like so:

$Func = $CmdLine[1]
Switch $Func
Case "command1"
    command1()
Case "command2"
    command2()
; etc etc

Func command1()
EndFunc
Func command2()
EndFunc

Share this post


Link to post
Share on other sites

Thanks.Let me try it out...:-)

Share this post


Link to post
Share on other sites

Is there any way to call a function from outside the script using auotIT ?

Maybe you can put all your functions in a au3 file for example myfunctions.au3.

Then in your current script put right at the top

#include "myfuntions.au3"

Now call your functions as if they are in the current 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