Jump to content

Executing AutoIt scripts withing AutoIt scripts?


Recommended Posts

Hi,

I'm trying to execute another AutoIt script within a script. While using Execute(*.au3), the other script is opened within scritp editor and does not run. Default behaviour for doubleclick is run script....

I also tried using Run() with compiled script, but I don't get a response....

Any ideas?

Cheers,

Bostjan

Link to comment
Share on other sites

Hello there. Not sure If this is what ur after.

For a script I'm currently working on, i needed an uncompiled script to run another uncompiled script.

I used Run("AutoIt3.exe Scriptname.au3") for it. I'm pretty sure this will work for a compiled script opening a uncompiled script.

Link to comment
Share on other sites

You can only execute one line of code. The string parameter that you pass to Execute contains the one line of code, it should NOT be a location to a file.

Example (from help file):

$a=1
$v=Execute("$a+1")  ; $v is set to 2

The poster above me is right: You use Run. Example:

$script = "C:\MyAu3Files\test.au3"
Run(@AutoItExe & " /ErrorStdOut /AutoIt3ExecuteScript " & $script)

More information is under help file: Command Line Parameters

Link to comment
Share on other sites

In that case.

If the scripts are in the same folder, you just need Run("Filename.exe"). Otherwise you need to include the file directory.

The thing is, I tried in the past and it didn't work, so I thought there was a catch ....

I've just recoded and it works now....:-) I don't know what was wrong, but it must have been some typo....

Thanks,

Bostjan

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