Jump to content
Sign in to follow this  
Ram

executing another au3 file

Recommended Posts

Ram

I would like to know how do I go about executing another au3 file.

For eg:

Test.au3

test2. au3

I have different script in test2.au3 and I want to write a command in test.au3 such that it can excute test2.au3..

Can some one help me out please!

Thanks!

Share this post


Link to post
Share on other sites
SmOke_N

I would like to know how do I go about executing another au3 file.

For eg:

Test.au3

test2. au3

I have different script in test2.au3 and I want to write a command in test.au3 such that it can excute test2.au3..

Can some one help me out please!

Thanks!

Do you have a short (I mean short) working example (other than the execution part of course) of both scripts?

I don't know if all you are looking for is /AutoIt3ExecuteScript or not.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Ram

Do you have a short (I mean short) working example (other than the execution part of course) of both scripts?

I don't know if all you are looking for is /AutoIt3ExecuteScript or not.

OK. Here is what I have. I have three different scripts. The mainscript checks the condiotion and should lauch the au3 script file accordingly.

Yep. I saw the example for /AutoIT3ExcuteScript but this seems to be little complicated as it needs to be executed on cmd line.

I thought Shellexcute will do it for me but When I execute that I get the script opened in the editor.

ShellExecute ("test2.au3")

Share this post


Link to post
Share on other sites
SmOke_N

OK. Here is what I have. I have three different scripts. The mainscript checks the condiotion and should lauch the au3 script file accordingly.

Yep. I saw the example for /AutoIT3ExcuteScript but this seems to be little complicated as it needs to be executed on cmd line.

I thought Shellexcute will do it for me but When I execute that I get the script opened in the editor.

ShellExecute ("test2.au3")
ShellExecute wont work unless you have made the necessary arrangements with the specific PC first.

I'm not sure I'm following the difficulty part though:

_Au3Execute(@ScriptDir & "\MyAu3Script.au3", "DoSomething")

Func _Au3Execute($hSourceFile, $sParams, $sWDir = @WorkingDir, _
                    $nShowHide = @SW_SHOW, $nSTDOut = 0)
    Return Run('"' & @AutoItExe & '" /AutoIt3ExeCuteScript "' & _
                $hSourceFile & '" ' & $sParams, $sWDir, $nShowHide, $nSTDOut)
EndFunc
This way, all you ever need is the AutoIt executable you created, rather than having to pack around and install all the necessary options that make an .au3 run on your PC.

Edit:

BTW, it's going to return the PID of the .au3/exe clone you just launched.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Nahuel

And this doesn't work?

ShellExecute ("borrar.au3","","","Run")

Share this post


Link to post
Share on other sites
SmOke_N

And this doesn't work?

ShellExecute ("borrar.au3","","","Run")
That worked for you on a PC that AutoIt isn't installed on?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Nahuel

That worked for you on a PC that AutoIt isn't installed on?

You had to make fun of me? :) haha

Sorry, I need to read posts more carefully.

Share this post


Link to post
Share on other sites
SmOke_N

You had to make fun of me? :) haha

Sorry, I need to read posts more carefully.

Nah... your mind was in a fun place... a "Oh I got SmOke_N now!!" ... I get "got" enough ;)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Ram

And this doesn't work?

ShellExecute ("borrar.au3","","","Run")
wow! this is what I am looking for this.. this worked perfectly fine..!! Thanks a lot guys!

Share this post


Link to post
Share on other sites
SmOke_N

wow! this is what I am looking for this.. this worked perfectly fine..!! Thanks a lot guys!

So you are only wanting to execute an Au3 script from another Au3 only if AutoIt is installed on that machine?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Nahuel

wow! this is what I am looking for this.. this worked perfectly fine..!! Thanks a lot guys!

hahahaha, in-your-face SmOke_N :)

(just kidding)

Share this post


Link to post
Share on other sites
Ram

So you are only wanting to execute an Au3 script from another Au3 only if AutoIt is installed on that machine?

Yep. You are right..

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.