Jump to content

Recommended Posts

Posted

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.

Posted

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...

Posted

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
Posted

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.

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
×
×
  • Create New...