Jump to content

executing another au3 file


Ram
 Share

Recommended Posts

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!

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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")
Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...