Sign in to follow this  
Followers 0
Lemures

Run a .au3 from within a .au3?

11 posts in this topic

Title says it all :P

The Run() command only runs .exe, .bat, and .com.... not .au3. I have several things I have to do to files in a row, and I have several scripts that I run in a certain order to do this. However, some times I only need to start halfway through, so I start with the middle one, this is why I have them seperate. How can I make one run the next, when I am constantly making small adjustments to the au3s?

Share this post


Link to post
Share on other sites



I havnt tested this or anything, but couldnt you just use #include?


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

That's a pretty clumsy use of #include and it's certainly not what the function was designed for. I'd recommend this:

Run(@AutoItExe & " /AutoIt3ExecuteScript YourFile.au3")

Of course this won't do much on a computer that doesn't have AutoIt installed.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

That's a pretty clumsy use of #include and it's certainly not what the function was designed for. I'd recommend this:

Run(@AutoItExe & " /AutoIt3ExecuteScript YourFile.au3")

Of course this won't do much on a computer that doesn't have AutoIt installed.

AFAIK this will use the interpreter stored in a compiled exe (when the script is compiled), so it should be fine for use on a computer with out autoit installed , as long as it is being called from a compiled executable.

[/AutoIt3ExecuteScript file] [params ...]

Execute another script file from a compiled AutoIt3 Script File. Then you don't need to fileinstall another copy of AutoIT3.exe in your compiled file.

Edited by SolidSnake

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

As long as the executed file does not use includes, that is.

Share this post


Link to post
Share on other sites

As long as the executed file does not use includes, that is.

The executed au3 file can have includes dependant on that an include folder resides next to the compiled script running the au3 file with the needed includes within the include folder. Otherwise the advice in the helpfile suggests using an a3x file which has includes compiled into the script.

Share this post


Link to post
Share on other sites

how do you make an a3x file?

Share this post


Link to post
Share on other sites

Couldn't you just put the whole autoit script you want to run in function and then tell it to do that function?

@Sokko: What would be "clumsy" about using Include # for something besides _Functions??


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

Couldn't you just put the whole autoit script you want to run in function and then tell it to do that function?

@Sokko: What would be "clumsy" about using Include # for something besides _Functions??

Edit: You could make several functions instead of several different autoitscripts? (I realize that if they're really long it would be annoying to use a function so in that case just ignore what I've said :P )


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

@Piano_Man

Going from what he posted,that would not work:

Title says it all :P

The Run() command only runs .exe, .bat, and .com.... not .au3. I have several things I have to do to files in a row, and I have several scripts that I run in a certain order to do this. However, some times I only need to start halfway through, so I start with the middle one, this is why I have them seperate. How can I make one run the next, when I am constantly making small adjustments to the au3s?


HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

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