Jump to content

How to have one script start another script?


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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