Sign in to follow this  
Followers 0
wrybread

Not possible to launch a script from within a script?

10 posts in this topic

I'm trying to launch an au3 file from within an au3 file using the Run command, and it errors out every time.

Is this forbidden?

Share this post


Link to post
Share on other sites



And another odd behavior: When I put the two scripts in the Programs/Startup folder, only one would run.

But when I click each shortcut manually, they both run fine.

Odd.

Share this post


Link to post
Share on other sites

I'm trying to launch an au3 file from within an au3 file using the Run command, and it errors out every time.

Is this forbidden?

Run() and RunWait() don't work with anything that isn't an executable. You will want to look at SlimShady's _ShellExecute() UDF.

Share this post


Link to post
Share on other sites

Simply more advantages to not compiling.

The AutoItExe macro uses the AutoIt that started your initial script.

Example:

RunWait(@AutoItExe & ' "' & @ScriptDir & '\Script.au3"')

Share this post


Link to post
Share on other sites

Simply more advantages to not compiling.

The AutoItExe macro uses the AutoIt that started your initial script.

Example:

RunWait(@AutoItExe & ' "' & @ScriptDir & '\Script.au3"')

That's great. Works. But there are two autoit.exe's running now. How can I kill the initial script without killing the second one?

RunWait(@AutoItExe & ' "' & @ScriptDir & '\MouseClick.au3"')

sleep (3000)

ProcessClose("AutoIt3.exe")

Doesn't work.

Share this post


Link to post
Share on other sites

Change:

RunWait(@AutoItExe & ' "' & @ScriptDir & '\MouseClick.au3"')

sleep (3000)

ProcessClose("AutoIt3.exe")

to

Run(@AutoItExe & ' "' & @ScriptDir & '\MouseClick.au3"')


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Thanks! So simple, yet so useful.

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