Jump to content

leojarrabi

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by leojarrabi

  1. Using Au3Info.exe, I could get the window information like the Title, Class, Advanced Mode, etc. The common information I usually use is there. The window class name is [CLASS:TfrmMain]. I could activate it using WinActivate, it returns true for WinExists as well. I also thought about "focusing the window" so I use WinActivate before using ControlSend, even the Send command, but I got nothing. I even set the SendKeyDelay thinking that the key press might be too fast for the program to react but still the same. What am I missing?
  2. We are trying to automate report generation for a software called MYOB BankLink (accounting software). The program would not open using Run or RunAs command but I was able to run it using ShellExecute($BankLinkPrg) I tried sending commands using ControlSend, Send, ControlClick but it isn't responding to any of it. I could Activate the window using WinActivate. I have attached here the opening interface of the program. Using a keyboard, I could do a File open by pressing Alt fgf. So I tried using: ControlSend("[CLASS:TfrmMain]", "", "", "{ALT}fgf"), did not work ControlSend("[CLASS:TfrmMain]", "", "", "!fgf"), did not work Anyone encountered this or have have created some autoit script for Banklink already? I tried searching this forum for the keyword banklink but it returns nothing. I am hoping somebody could help me, thanks!
  3. I see, it can be declared as a combination. I should have declared it as Local $hLogFileinUTF8 = FileOpen($LogReport, $FO_APPEND + $FO_UTF8_NOBOM) Thanks!
  4. I still haven't figure out why i can't write on the file in utf8 mode. When i open the file in append mode, the program could write on the file but the characters are inly showing as question mark. Is this a bug in autoit?
  5. I will also use FileGetEncoding function to make sure that it will return 256 before it actually process the file. But for now, I just need to list the characters that are not listed in my "valid list".
  6. $FO_UTF8_NOBOM (256) = Use Unicode UTF8 (without BOM) reading and writing mode. I assume it means that the file is in write mode? Or am I wrong? So how do I open the file in UTF8 mode so I could write to it as well in UTF8 mode?
  7. I am having a problem writing/creating a log file that contains non-ANSI characters. I used fileopen with $FO_UTF8_NOBOM parameter and passed it to FileWriteLine as suggested in the manual (https://www.autoitscript.com/autoit3/docs/intro/unicode.htm) Here's my code: #include <File.au3> Local $hFileOpen = FileOpen($CmdLine[1], $FO_UTF8_NOBOM) Local $sFileContent = FileRead($hFileOpen) $LogReport = $CmdLine[2] If _FileCreate($LogReport) = 0 Then MsgBox(0, 'Permission Denied', 'Could not create log file') Exit EndIf Local $hLogFileHandle = FileOpen($LogReport, $FO_UTF8_NOBOM) ; list of valid characters to be used in Regular Expression Pattern $AccentedChars = "âãäåæçèéêëìíîïàñòóôõöøùúûüýÿāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥħĨĩĪīĬĭ" $PunctuationMarks = "“”‘’'"";&_:–,\.\?\!" $Braces = "\(\)\[\]<>" $MathOperators = "/\-=$" $OtherValidCharacters = "©" ; Look for non-ANSI character that is not on the list above $asResult = StringRegExp($sFileContent, '([^0-9A-Za-z\s' & $AccentedChars & $PunctuationMarks & $Braces & $MathOperators & $OtherValidCharacters & '])++', 3) $ListOfInvalidChars = "" For $i = 0 to UBound($asResult)-1 If StringInStr($ListOfInvalidChars, $asResult[$i]) = 0 Then $ListOfInvalidChars = $ListOfInvalidChars & $asResult[$i] Next if $ListOfInvalidChars <> "" Then ;write the list of characters found into the log file, hopefully as UTF8 so I could actually see what the character was and not just a ? character MsgBox(0, "Found", $ErrorMessage) FileWriteLine($hLogFileHandle, $ErrorMessage) Else MsgBox(0, "Result", "No error") Endif FileClose($hLogFileHandle) On the test file I am using, I placed a non-ANSI character. I know that it was able to detect that because of the Msgbox before writing it to the log file. When the script is finished, the log file contains nothing. I though it would be the Autoit version. I am using 3.3.10.2. Unicode support starts on version 3.2.4.0 so my version should be fine, right? Any help would be appreciated.
  8. No I haven't tried running it in compiled format because we've been changing it a lot because of the classname of the applications we are accessing changes everytime we install it on a different machine. I have tried your suggestion and compiled it, it works like a charm, though we have to adjust some part of our workflow process to reflect exe instead of au3. Thank you very much for the help! I just wonder, why would it run on Server 2008 in au3 format but not on 2012?
  9. We were using Windows Server 2008 before and our autoit is running there just fine. The autoit script is using cmdline variable so it would know what file needs to be processed. It is run like this in commandline: test.au3 "C:MyTestFile.doc" But when we tried running the same script on Window Server 2012 we are getting an error "Array variable has incorrect number of subscripts or subscript dimension exceed" So what I did is I created a much simpler autoit script: Msgbox(0, "", $CmdLine[1]) It causes the same error. I changed it to: Msgbox(0, "", $CmdLine[0]) Then run it in CommandLine test.au3 "C:MyTestFile.doc", it returns 0 instead of "C:MyTestFile.doc" Any help would be appreciated! Thanks!
×
×
  • Create New...