Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/25/2024 in all areas

  1. FWIW, this change appears to be intentional -- https://chromium.googlesource.com/chromium/src/+/6f33d75f071e322c4a3e49b0a4ac2022e5b6cada
    2 points
  2. RDE

    Win 11 install failure

    Many, many thanks for that, I would never have thought of looking there! How unlucky is that? re-installing on the day after a new version of chromedriver crashes everybody.
    1 point
  3. pixelsearch

    Simple Google Translate

    Here is a pic of the reworked script, it should be finished in a few days. Maybe I should open a new topic for this, or continue here ?
    1 point
  4. I think similar to Part of the problem is how the 'Console' works in an uncompiled script. You're running it through the AutoIt.exe process, not through SciTE or its own process. You're not inputting into the 'correct' console window, is basically my thought. So, basically, you cannot do what you want unless you compile the script, and do you things from the console window of the direct .exe file. As for why Execute is not working, that's because of CR/LF/CRLF, basically. I tested your code, and some example code built from the help file entry for Execute, and I got it working: #include <MsgBoxConstants.au3> #cs Compile this script to "ConsoleRead.exe". Open a command prompt to the directory where ConsoleRead.exe resides. Type the following on the command line: echo Hello! | ConsoleRead.exe When invoked in a console window, the above command echos the text "Hello!" but instead of displaying it, the | tells the console to pipe it to the STDIN stream of the ConsoleRead.exe process. #ce ; MouseClick("main", 436, 451, 1, 10) ; Copy this and try executing that, or whatever you want Example() Func Example() If Not @Compiled Then MsgBox($MB_SYSTEMMODAL, "", "This script must be compiled in order to run the example.") Exit EndIf Local $sOutput While True Sleep(25) $sOutput = ConsoleRead() ;~ If @error Then ExitLoop If $sOutput <> '' Then MsgBox($MB_SYSTEMMODAL, "", "Received: " & @CRLF & 'Type: ' & VarGetType($sOutput) & @CRLF & $sOutput) Execute(StringStripCR(StringStripWS($sOutput, 1 + 2))) ; $STR_STRIPLEADING + $STR_STRIPTRAILING If @error Then MsgBox($MB_SYSTEMMODAL, "", "Execute $sOutput error: " & @CRLF & @CRLF & @error) EndIf EndIf WEnd MsgBox($MB_SYSTEMMODAL, "", "Received: " & @CRLF & @CRLF & $sOutput) EndFunc ;==>Example Give that a shot (compiled) and see if it works for you, it did for me (sending the MouseClick line in there). Keep in mind then that this will only work for single line things. Edit: Also take a look at https://www.autoitscript.com/autoit3/docs/intro/running.htm, specifically: AutoIt specific command Line Switches And keep in mind that to use AutoIt3ExecuteScript or AutoIt3ExecuteLine, the file needs to be compiled with this flag: #pragma compile(AutoItExecuteAllowed, true)
    1 point
×
×
  • Create New...