
9252Survive
Active Members-
Posts
25 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
9252Survive's Achievements

Seeker (1/7)
0
Reputation
-
9252Survive reacted to a post in a topic: Function to insert values in a MS SQL Table
-
Function to insert values in a MS SQL Table
9252Survive replied to 9252Survive's topic in AutoIt General Help and Support
Hello mLipok! I did try your UDF but I am very certain that I might not have done it correctly, I also tried the ADO_API.au3 but did not work. Could you show me an example to enter above given data or anything rather using integrated Security" or "Trusted_Connection? -
Hello guys! I am having some difficulty in achieving a very simple task here. I have gone through the forums and tried some examples and UDFs but I can't seem to work it out. I would really appreciate if someone could help me out. Problem: Currently, I am logging the required feedback from the script into a log file in a simple way ... get the info in the var >> write it in the file But now I am in need to perform some analysis and need some of the values to go into an MSSQL table in the attached format Also, I need to be able to use Integrated Security" or "Trusted_Connection set as true or use the logged in windows credentials to connect to the server/database any help will be much appreciated!!! Thanks!
-
Script messages in Tray
9252Survive replied to 9252Survive's topic in AutoIt General Help and Support
Sorry its not working with the compiled exe, works with the scipt only. -
Script messages in Tray
9252Survive replied to 9252Survive's topic in AutoIt General Help and Support
Oh Yes!! Now I recall it, that should do the job! Thanks -
Hello Guys, Is there a way to have Auto it Exe messages/line number when you hover over the tray icon just at it shows when you run Au3.? For an example, if I the script has paused due to WinWait or Sleep I could hover over the icon and it shows the line where it's at. Is there a way to achieve the same with the compiled exe? Many thanks for the help!
-
Hi All, I am fairly new to AutoIT and I am still trying to learn, I have been using _FileListToArray to list all the files with a particular extension in an array and then loop through it for operation ( For $i = 1 To UBound($FileArray) - 1). So far this has been working fine. But I am not able to figure out a problem that I have; what if I have 50 files but I only want to loop through first 10 files and then next ten and so on? Or rather I should say, how I can I only feed max 10 files to the array at a time when I do _FileListToArray regardless of the total number of files in the folder? Any insight/help will be much appreciated
- 2 replies
-
- arrays
- filelisttoarray
-
(and 1 more)
Tagged with:
-
AutoIT on Win 7 VM {.exe wont run}
9252Survive replied to 9252Survive's topic in AutoIt General Help and Support
I think I found the problem ...testing now. But I will also use WinList to test in case the problem persists. Thanks -
AutoIT on Win 7 VM {.exe wont run}
9252Survive replied to 9252Survive's topic in AutoIt General Help and Support
AutoBert.... I wanted to use a UDF to keep only on instance running at a time and this seems to work really well. Is there a standard way to do this? Please advise. Thanks http://h--e.de/autoit/UDF/_SingleScript.html -
AutoIT on Win 7 VM {.exe wont run}
9252Survive replied to 9252Survive's topic in AutoIt General Help and Support
I have this in the script and it shows me where it is pausing. Is this not the same as yours? Opt("TrayIconDebug", 1) ;0=no info, 1=debug line info -
AutoIT on Win 7 VM {.exe wont run}
9252Survive replied to 9252Survive's topic in AutoIt General Help and Support
As you can see there are couple of winwaitactivate in the script...the script keeps waiting for the window even when the window is active and sometimes it detects some other window. The version which works perfectly wont go past that point and the only way I was able to get it working was by re declaring the variable that stores the window title by WinGetTitle("[ACTIVE]") ( $TalpacTitle2 = WinGetTitle("[ACTIVE]")) ( not the best way to do it but this is the only way I was able to get it to see the active window and move forward). Another way would be to create the array of absolute names and then loop through them. I haven't tried that yet but I am so confused now that why wont this work now. This has been working perfectly on workstations and the only difference now is that its on a WIN 7 Virtual Machine. -
Hello Water, Sorry, I have been tied up with some other stuff and this was side tracked I will try your suggestion and report later. Thanks again!
-
Hi All, Once again returning back to this great community for much needed help. I am sure that I wont be disappointed and you guys will point me in the right direction. To begin with, I am very new here and I have been learning AutoIT. Few months ago I was able to write a script to automate a program to perform some desired task and it has been working great. But, all hell broke lose when I moved this to a Windows 7 VM the script wont even perform the first key commands and after few changes in the code it started working but break intermittently also the compiled scripts wont work at all. Any help will be much appreciated.
-
Hi I am again getting the same error that I posted in the beginning of this thread. The strange thing is that it works on one computer and not another. I just copied the script to another pc and it wont work and same is the case with the compiled exe. Below given is the code that uses INI file ( as I mentioned in my last post) and attached is the error. #AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y #include <MsgBoxConstants.au3> #include <Debug.au3> #include <File.au3> #include <WinAPI.au3> #include <GuiComboBox.au3> #include <Date.au3> #include <AutoItConstants.au3> #include <Array.au3> #include <Process.au3> #include <StringConstants.au3> #include <FileConstants.au3> ; include for file functions #include <WinAPIFiles.au3> #include <_SingleScript.au3> #include <WinNet.au3> #include <Timers.au3> #include <INet.au3> #include <OutlookEX.au3> #include <TrayConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #Region AutoIT_Options Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=No case Opt("WinSearchChildren", 1) ;0=no, 1=search children also Opt("TrayIconDebug", 1) ;0=no info, 1=debug line info Opt("TrayAutoPause", 0) ; 0 = no pause , 1 = pause when tray icon is clicked #EndRegion AutoIT_Options Global $ImportFiles Global $RootSHM Global $Site Global $Truck Global $j Global $i Global $SiteArray Global $MsgType Global $TruckArray Global $logfilepath Global $logFileName = "Test" & "-" & @YEAR &"_"&@MON& "." & "log" Global $LastModTime Global $LastModTimeStamp Global $Filecount Global $FiletoCheck_1 Global $FiletoCheck_2 Global $oOutlook = _OL_Open() Global $Message Global $Email Global $Inifile = @ScriptDir & "\FileWatcher.ini" Global $Freq Global $sdata Global $Env Global $tdata If FileExists($Inifile) = 0 Then ; Check if .INI file exists _CreateIni() EndIf _GetValues() ; Read INI file for values Func _CreateIni() ; IniWrite used to create the file and add section/keys. IniWrite($Inifile, "Project", "Root", "\\fcgwnt01\share.$\StandardHaulage\TEST\") IniWrite($Inifile, "Project", "Email", "TestEmail@gmail.com") IniWrite($Inifile, "Project", "Frequency", "60000") IniWrite($Inifile, "Project", "Logfile path","\\testpc\test\FileWatcher\V5") EndFunc ;==>_CreateIniV5 Func _GetValues() ; Read the INI File $RootSHM = IniRead($Inifile, "Project", "Root", "\\testpc\TEST\") $Email = IniRead($Inifile, "Project", "Email", "TestEmail@gmail.com") $Freq =IniRead($Inifile, "Project", "Frequency", "60000") $logfilepath=IniRead($Inifile, "Project", "Logfile path","\\testpc\test\FileWatcher\V5") If $RootSHM = "" Then $RootSHM = "\\testpc\TEST\" EndIf If $Email = "" Then $Email = "TestEmail@gmail.com" EndIf If $Freq = "" Then $Freq = "60000" EndIf EndFunc ;==>_GetValues Global $logfile = $logfilepath &"\"& $logFileName Func _SendAlert($MsgType,$Message) If $MsgType = "0" Then $MsgType = "ALERT!" Else If $MsgType = "1" Then $MsgType = "Notification-Processing Complete" Else If $MsgType = "2" Then $MsgType = "Notification-Processing Pending" EndIf EndIf EndIf If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) ;Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name ;_OL_Wrapper_SendMail($oOutlook, $sCurrentUser, "", "", " ALERT! ", "An error has occurred, the log file has not changed since: " & $LastModTimeStamp, "", $olFormatHTML, $olImportanceHigh ;_OL_Wrapper_SendMail($oOutlook, "TestEmail@gmail.com", "", "", " ALERT! ", "An error has occurred, the log file has not changed since: " & $LastModTimeStamp, "", $olFormatHTML, $olImportanceHigh) ;MsgBox("","",$Email) _OL_Wrapper_SendMail($oOutlook,$Email, "", "", " - "& $MsgType, $Message, "", $olFormatHTML, $olImportanceHigh) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) ;MsgBox(64, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Mail successfully sent to user '" & $sCurrentUser & "'!") EndFunc Func _ChecklogFile() ;$FiletoCheck_1 = FileGetTime($logfile,0,1) $FiletoCheck_2 = FileGetTime($logfile, 0, 1) ; Timestamp If $FiletoCheck_1 == $FiletoCheck_2 Then ; if the time stamp has not changed ;Msgbox("","","File has not changed") _SendAlert(0,"An error has occurred, the log file has not changed since: " & $LastModTimeStamp) Else ;Msgbox("","","File has changed") EndIf EndFunc $FiletoCheck_1 = FileGetTime($logfile,0,1) ; Initial Launch, grab current GetTime ;MsgBox("","",$logfilepath) ;MsgBox("","",$logfile) ;MsgBox("","",$FiletoCheck_1) Func _SplitDT($file) Local $YYYY = StringLeft ( $file, 4 ) Local $MM = StringMid ( $file,5,2) Local $DD = StringMid ( $file,7,2 ) Local $HH = StringMid ( $file,9,2 ) Local $Min = StringMid ( $file,11,2 ) Local $SS = StringMid ( $file,13,2 ) $LastModTimeStamp = $YYYY&"-"&$MM&"-"&$DD&" "&$HH&":"&$Min&":"&$SS EndFunc While 1 Sleep($Freq) ; check every 10 mins _SplitDT($FiletoCheck_1) _ChecklogFile() $FiletoCheck_1 = FileGetTime($logfile,0,1) ; reset the timestamp WEnd _OL_Close($oOutlook)
-
Hello, I am in a fix with this problem and I cant seem to find a viable solution. As you would know that the AutoIT scripts can go in pause mode for many reasons. It could be simply WinWait() that could take the script into that state. I do understand that a better design could help a lot but I would like to handle such situation with existing my code. To simplify my query - I am looking for a way to calculate how long the given script/compiled script has been in "pause" state. Is there a way to do that? For example, if my script has been in pause state for 3 hours I would like to kill or restart the pc . I do understand that Auto IT is not multi-threaded but is there a way to achieve what I am trying to? Any help or suggestion is much appreciated. Thanks