Jump to content

Recommended Posts

Posted

i need help im trying to make a script and right in the middle of it you type in a file and the script will read it and use it like an include but i cant figure out how to do it because you cant use #include with a variable

Posted

If you want it to read and process data, you could do an INI file, or you could have it filereadline data in.

If you want it to read in autoitscript, then you can have autoit create an autoit file that includes the code and run that.

ex:

; bunch of stuff before this
FileDelete (@TempDir & "\foo.au3")
FileWriteLine (@TempDir & "\foo.au3", "#include " & $x)
FileWriteLine (@TempDir & "\foo.au3", "msgbox(1,'included file'," & $x & ")" )

RunWait("C:\Program Files\AutoIt3\AutoIt3.exe " & '"foo.au3"', @TempDir)
; rest of script, you could do a filereadline loop to grab and insert if you like as well.

Compiled EXEs have to have all the script they will execute before hand, but you could even include the autoit.exe in your script and execute it that way.

More than one way to skin a cat....

AutoIt3, the MACGYVER Pocket Knife for computers.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...