Access the .au3 file from the .au3 file

How can I access the .au3 file in the "My Documents / Downloads" folder from another .au3 file?

I know how to access the file from the desktop from this code:

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

But I can’t access it in the β€œMy Document / Downloads” folder. Basically I want to recursively call the same .au3 file again and again.

+4
source share
2 answers

As an alternative, you can run the program in the desired folder:

 Run(@AutoItExe & ' "' & @MyDocumentsDir & '\Downloads\file2.au3"') 

Also, if you want to use a method like the other, you can use #include inside the loop.

+6
source

Calling an au3 file from another au3 file seems a bit redundant. Could you just copy the code you need from the au3 file to the same file and then put it in a loop? For example, the next ode will run the code 10 times.

 For $i = 1 to 10 ;Code from file2.au3 MsgBox(0,"", $i) Next MsgBox(0,"", "Done!") 
+5
source

All Articles