Jump to content
Sign in to follow this  
frew

How to have one script start another script?

Recommended Posts

frew

Hello,

What's the best way to have one script run another script?

Run does not do it.

ShellExecute opens the .au3 into the Scite editor.

I don't get how to use the macros stuff @AutoItExe, @ScriptDir & "\my.au3 run etc...I just can't figure out the correct syntax to get that to work.

Okay, so I have script1.au3 running and part way through it I want to have it start up script2.au3.

Would somebody give me an example of what to put into script1.au3 to have it start script2.au3?

I don't want to make the scripts into exe in order to use Run to start them....I just want to leave them as .au3

I don't see how to do it in helpfile, FAQ, or forum search.

Thank you very much,

frew

Share this post


Link to post
Share on other sites
Valuater

See "Autoit Wrappers" for this and MANY helpful Scriptlets

... Click "Great Programs" below

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
frew

Thank you Valuater.

I was hoping for a very simple line of code...because even what you point me to is a bit over my head.

Sadly I'm still on Windows 98SE...yes, I know...and I don't think the Welcome to AutoIt 1-2-3 works for this OS.

Can you straighten out this syntax

Run(@AutoItExe & "C:\Program Files\AutoIt3\Scripts\" & "script1.au3")

I don't get the macro stuff yet, so please just straighten out that line as it needs to be, without me having to replace any code language with paths etc...because that's where I get mixed up with the syntax.

I just want to pop a simple line into a script1.au3 that will start up script2.au3.

Thank you very much,

frew

Share this post


Link to post
Share on other sites
frew

Okay, here's part of my confusion...turns out spaces in the path are a problem.

This works:

ShellExecute(@AutoItExe,"C:\Hello.au3")

This does not work:

ShellExecute(@AutoItExe,"C:\Program Files\AutoIt3\Hello.au3")

The space in the path at Program Files causes an error...and the script will not run.

Is there anything I can put in the path to make it work? Like what do they do sometimes in html? Is it like

Program%20Files or something like that.

Oh well...thanks for any idea for me to try.

frew

Share this post


Link to post
Share on other sites
Malkey

Okay, here's part of my confusion...turns out spaces in the path are a problem.

This works:

ShellExecute(@AutoItExe,"C:\Hello.au3")

This does not work:

ShellExecute(@AutoItExe,"C:\Program Files\AutoIt3\Hello.au3")

The space in the path at Program Files causes an error...and the script will not run.

Is there anything I can put in the path to make it work? Like what do they do sometimes in html? Is it like

Program%20Files or something like that.

Oh well...thanks for any idea for me to try.

frew

This works on my xp.

ShellExecute(@AutoItExe,"Hello.au3","C:\Program Files\AutoIt3")

The optional working directory parameter included.

Share this post


Link to post
Share on other sites
frew

Malkey, I want to thank you so much for sending along your test of this.

Yes, that's what I was looking for...I just had to get the layout of the syntax right.

Okay, I've got it now. Beautiful!

Spaces in path not a problem now. Just had to switch things around and put the filename before the path.

I wasn't thinking of the filename as a parameter...I think the helpfile could be a bit more clear on this point with some more examples. But you've helped me sort it out.

Thanks so much!

Seeya,

frew

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.