8 posts in this topic
I'm currently working a program that constantly prints out log files through "consolewrite" and the "#AutoIt3Wrapper_Change2CUI=y" wrapper.
Part of this program requires me to run a batch script.
My issue is the batch script launches from the same window as consolewrite. I need the batch file to be launched through a different window as currently this causes an issue with the logs (which need to be very precise) but also causes the batch file to produce some funny behavior...
Does anyone know how I can force the file to run on a second DOS window?
Thanks in advance!!!
Edit: Im using the "run" command if that helps. I tried "shellexecute" but that seemed to not launch the batch scripts at all.
I might be doing something wrong but I'm running a CUI compiled application in Powershell ISE and it's not outputting unicode characters in the console. I for a fact Powershell ISE supports unicode so I'm thinking it's something with AutoIt. Does ConsoleWrite just not output Unicode? Do CUI compiled applications run inside the old Windows Console when executed through Powershell? is there something else preventing this?
So I have a little script here
Func getThe () Local $nearPix = 0123 Local $winPos = WinGetPos ($workWin) FFSaveBMP ("yBarPosArea", "True" , 600, 239, 600, 555, 30, $workWin) $nearPix = FFNearestPixel (600, 220, "0xC1C1C1" , False, $workWin) If $nearPix == 0123 Then ConsoleWrite ("No val for NearPix") ElseIf $nearPix <> 0123 Then ConsoleWrite ("Val is there") ConsoleWrite ($nearPix&","&$nearPix&@CR) EndIf EndFunc And when it comes time to run it I get a return of
When it says "non-accessible variable" , what is it meaning by that? The scope is "Local" and it is within the same function. The variable was even referenced in the step right before the one throwing the error. Any insight would be thoroughly appreciated. Thank you!
Here is my code. Adopted from a post UEZ made.
_GenerateUID() Func _GenerateUID() Local $lReturn, $lDriveSerial,$lRandomSeed = "" Local $lChr For $N = 1 To 32 $lChr = Chr(Random(65, 90, 1)) ;A-Z $lChr = Chr(Random(48, 57, 1)) ;0-9 $lRandomSeed &= $lChr[Random(0, 1, 1)] Next $lDriveSerial = DriveGetSerial(StringLeft(@WindowsDir, 3)) $lReturn = StringToBinary($lRandomSeed & $lDriveSerial) ConsoleWrite($lReturn) ;<--- Is printed as a String. ConsoleWrite(@CRLF & $lReturn & @CRLF) ;<--- Printed properly as Binary? Return $lReturn EndFunc ;==>_GenerateUID Output:
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop V9P03Y144OZW38YC80IW1IJXWH4003501486415223 0x5639503033593134344F5A57333859433830495731494A58574834303033353031343836343135323233 +>10:40:52 AutoIt3.exe ended.rc:0 +>10:40:52 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.544
Whenever ConsoleWrite is fed pure binary, it will output it as a string. Whenever a string is mixed with the binary, it outputs the binary as binary.
I found this especially confusing when I consulted the Help Documents for an answer...
I'm sure I'm missing something, as usual. As always, thanks for your time!
I've been experimenting with the colour options for the SciTE script editor included with AutoIT's full installation, and seem to be having a bit of trouble achieving the colours I'm after....
After reading the given documentation for ConsoleWrite (the function i'm trying to use), I can see that the default colours are chosen with the following parameters:
! = Red > = Blue - = Orange + = Green However, I'm receiving the following;
As you can see, the output is still formatted with colours, Only they're not what I was expecting.
I assume this is a setting in SciTE rather than the AutoIT language, Has anyone come across any settings within SciTE regarding console colouring? I've been through various properties and settings for SciTE. but can't seem to find anything that references console or colour.
May sound like i'm grasping at straws a bit here, But I'm after formatting certain outputs with red text more than anything.
Any help is greatly appreciated.