Jump to content

Why can't I do this?


Recommended Posts

Why can't I do this:

AutoIt3.exe /c "MsgBox(4096,'Example', WinWait('Test','Test-text'))"

... or this:

AutoIt3.exe /c "MsgBox(4096,'Example', $var = WinWait('Test','Test-text'))"

... or this:

AutoIt3.exe /c "MsgBox(4096,'Example',' ' $var = WinWait('Test','Test-text'))"

... or for that matter this:

MsgBox(4096,'Example','' $var = WinWait('Test','Test-text'))

ARRRGH. :)

Also, is it possible to have multi-line commands with the "/c" switch?

Thanks!

-Brian

Link to comment
Share on other sites

The last 3 won't work, because they have an invalid syntax.

The first one will work. I tried it out and AutoIt did not return an error.

If you want to execute multiple lines, you create a script.

Just like CMD and batch files: you can do COPY %windir%\notepad.exe and cmd /c COPY %windir%\notepad.exe

Edited by SlimShady
Link to comment
Share on other sites

You're right, the first one does work. Damn, I don't know what I was thinking there... :)

I think I know what happened: I had UltraEdit opened and was previously using it as a scratchpad to compose the command and copy and paste it into the "Run..." dialg (<Win + R>). At some point I got confused and decided to save the file as an .AU3 file and tried to execute that from my address bar... hehe So naturally when the AutoIt3 interpreter generated an error, I assumed it was my syntax and tried different ways to test the same command :D

Regarding the creation of a script: I guess you could do that, but it would be nice if it supported arbitrary # of commands w/o requiring to create a new text file... like (Super or GNU) SED. It would be a quick way to test something w/o having to invoke notepad, save the file, find it again, and execute it.

Thanks!

-Brian

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