10 posts in this topic
UDF to intercept the error window of AutoIt, showing more details about the error, including ability to save and send by email!
I am attempting to drag and drop a file from one windows explorer window to another windows explorer window (henceforth referred to as window1 and window2). I am not using the web. I have used autowinexp.au3 (taken from LarsJ's automatewindowsexplorer.au3) to give focus (function GetFileFocus) to a file on window1. The problem is that sometimes the file with the focus is not displayed on window1 because it is farther down the list than what is displayed in window1. There are other ways to accomplish this (like copy and paste) but I want to emulate the GUI doing a drag and drop. I work as a digital forensicator and my task is to examine what artifacts are left behind on move/copy vs a drag and drop. Please note that when I open window1 and window2 they are on top of each other, so I drag window2 over about 1150 pixels and that part works great.
My code is listed below. Please understand that I have tried several different methods to accomplish this task. The last one was to estimate that the top of the window1 header is approximately 320 pixels and to multiply the index of the file by 20 pixels since that appears to be the approximate height of individual files using the AutoIT Windows Info tool. Ideally the program would search window1 for the file name text and provide a mouse position for it. Or the program would allow me to scroll to where the file name is located. Any and all ideas are welcome.
Using Windows 10
PS Any problems in autowinexp.au3 are mine and not the author of automatewindowsexplorer.au3.
Is this possible:
Executing a function from an include, but taking the function name from a gui input and then executing that function using the include:
#include <Something.au3> ;input reads "Tree" $functionName = GuiCtrlRead($input1) $functionName(1) And the include is gonna have
Func Tree($x) If $x = 1 Then $this = "text" MsgBox(0,$this,"whatever") EndFunc is it possible?
I get this error, Whenever I try to find a date. Does anyone have any idea why? I saw some post from 2015, However I would imagine this is fixed by now. @water
>"J:\Temporary Files\XXXXXXXXX\AutoIt\AutoIt\AutoIt\SciTe\..\autoit3.exe" /ErrorStdOut "C:\Users\XXXXXX\Desktop\Call Report Automation.au3" "J:\Temporary Files\XXXXXXXX\AutoIt\AutoIt\AutoIt\Include\Excel.au3" (656) : ==> The requested action with this object has failed.: $aResult[$iIndex] = $oMatch.Name.Name $aResult[$iIndex] = $oMatch^ ERROR >Exit code: 1 Time: 5.791 #include <Excel.au3> Global $sExcelFile1 = FileOpenDialog("Choose/Create Excel File", @ScriptDir, "(*.xlsm)") Global $sExcelFile2 = FileOpenDialog("Choose/Create Excel File", @ScriptDir, "Excel Sheet (*.xlsx;*.xls)|All (*.*)") If FileExists($sExcelFile2) Then Global $oExcel2 = _Excel_Open () $oExcel2 = _Excel_BookOpen($oExcel2,$sExcelFile2) EndIF If FileExists($sExcelFile1) Then Global $oExcel1 = _Excel_Open () $oExcel1 = _Excel_BookOpen($oExcel1,$sExcelFile1,Default,Default,"2007") EndIF $oRead = _Excel_RangeRead ($oExcel2,Default,"A2",3) _Excel_RangeWrite ($oExcel1,"Calls Handled",$oRead,"BY7") Sleep (1000) _Excel_RangeFind ($oExcel1,$oRead,"E4:FD92") MsgBox (0,"Test",$oRead) UPDATE:
If I take out this line it works. By works I mean I don't get the error. :/ However, I need it. I am just confused.
_Excel_RangeWrite ($oExcel1,"Calls Handled",$oRead,"BY7")
UPDATE 2: I also get this error when trying to use the helpfile examples. I have version 184.108.40.206
\AutoIt\AutoIt\AutoIt\Include\Excel.au3" (670) : ==> The requested action with this object has failed.: $oSheet = $oWorkbook.Sheets($iIndexSheets) $oSheet = $oWorkbook^ ERROR >Exit code: 1 Time: 0.8931
How would I go about writing a IF Then statement if the conrol send fails?
Run ("Notepad.exe") WinWaitActive ("Untitled - Notepad") ControlSend("Untitled - Notepad", "", "Edit1", ("Provider Practice Record")) I have been running into lag alot. So my script has been missing input. I would like to be able to have it retry to put in "Provider Practice Record" if it misses.
I am assuming a if then statement is what I need but I am not sure what ControlSend will return if it tries to send to Edit1 and it is not there.
Or do I need to just add a timeout?