Jump to content

Au3 Script Run


Recommended Posts

You can use _FileCreate or FileInstall, but like you said, you...

...would need the .exe that creates the .au3 to run it.

Look in the help file > Running Scripts

Form3: Compiled.exe [/ErrorStdOut] [/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.

Here are several sripts that use the /AutoIt3ExecuteScript switch to run a second script that was created by the main script:

http://www.autoitscript.com/forum/index.php?showtopic=22531

The macro named @AutoItExe will (according to the help file) return:

The full path and filename of the AutoIt executable currently running. For compiled scripts it is the path of the compiled script.

I added the bold.

-MSP-

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

Link to comment
Share on other sites

So, wait, how would I use that?

You would use it to "...take a compiled .au3 script (.exe) and run a .au3 with it on a computer that doesn't have AutoIt V3 installed?"

@AutoItExe tells the compiled script to use itself to run your au3 file.

You can create or install the au3 file many different ways. The examples that I posted just uses FileWrite to create the au3. You could use FileInstall, but then you could not create the au3 on the fly - using info gathered from the user by the main compiled EXE. [unless you had the scripts talk to each other.]

Or maybe you had something else in mind - like you could give someone a compiled AutoIt EXE that does nothing but prompt the user for the path to an au3 that they wrote and then your EXE runs that au3.

...I don't know, how would you use the info that I pointed to? :-)

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

Link to comment
Share on other sites

Well ok, here is an example:

#include <File.au3>
_FileCreate("Test.au3")
$1 = FileÜ[    ][ÝÕÝ]][ÝË
B[]S[J   ÌÍÌK ][ÝÓÙÐÞ
    ÌÎNÉÌÎNÂb33µFW7Bb33²gV÷C²¤fÆT6Æ÷6Rb33c³£´ç6W'BgVæ7FöâFò'VâgV÷CµFWйÔÌÅÕ½Ðì(
Link to comment
Share on other sites

Try this:

#include <File.au3>
_FileCreate("Test.au3")
$1 = FileO[ ][ÝÕÝ]][ÝËB[]S[J ÌÍÌK ][ÝÓÙÐÞ
    ÌÎNÉÌÎNËb33µFW7Bb33²gV÷C²¤fÆT6Æ÷6Rb33c³ ¥'VâWFôDWRfײgV÷C²ôWF%ÐÍáÕÑMÉ¥ÁÐÅÕ½ÐìµÀìMÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈíQÍйÔÌÅÕ½Ðì¤

I did not mean to sound rude in my last post - I thought that you were looking for ideas/ways to use the concept of running a script from a script. Hence my:

...I don't know, how would you use the info that I pointed to? :-)

The code above works as an au3 or as a compiled script.

It makes another test.au3 file and runs it.

I changed this: $1 = FileOpen("Test.au3",2) in your code.

The sample code that I pointed you to was about how to move a MsgBox to other places on the screen... just as a way to demonstrate the power of AutoIt3ExecuteScript.

...hope this helps...

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

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