thestormdragon Posted February 16, 2017 Share Posted February 16, 2017 (edited) Hi I'm trying to use imagesearch2015.au3 (downloaded from these forums and attached to this post) to determine if/when an error is thrown and I have a really basic issue - simply having "#include <imagesearch2015.au3>" in my script stops the whole thing from running. I've tried a really simple script for test purposes (to check it's not something in my huge script):- #include <imagesearch2015.au3> msgbox(0,"Before Image Search","Before Image Search") $x1 = 0 $y1 = 0 $image = "C:\Users\lvwv8509\Documents\zz_macro source\CoS_Error_01_Unable_to_read_file (OK not Selected).bmp" _ImageSearch($image, 1, $x1, $y1, 0, 100) MouseMove($x1, $y1, 1) Sleep(2000) MouseClick("Left") MsgBox(0, "", "Found the image") when I run this (either from ScITE or by compiling it) I don't even get the "Before image search" messagebox appear. If I comment out / remove the #include then the messagebox appears. The output when running the script WITH the #include is below and looks normal to me >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\lvwv8509\Documents\zz_macro source\test imagesearch2015.au3" /UserParams +>12:43:31 Starting AutoIt3Wrapper v.16.612.1119.0 SciTE v.3.6.6.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\lvwv8509\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\lvwv8509\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.2) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\lvwv8509\Documents\zz_macro source\test imagesearch2015.au3 +>12:43:31 AU3Check ended.rc:0 >Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\lvwv8509\Documents\zz_macro source\test imagesearch2015.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop +>12:43:31 AutoIt3.exe ended.rc:0 +>12:43:31 AutoIt3Wrapper Finished. >Exit code: 0 Time: 1.24 I'm on Win 7 Enterprise, X64, latest ScITE and autoit. FYI - the error doesn't take the window focus (thanks Excel) so doing an image search is the only way I can catch this. If anyone has any thoughts I'd be ever so grateful. Many thanks in advance David ImageSearch2015.au3 Edited February 16, 2017 by thestormdragon Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 16, 2017 Moderators Share Posted February 16, 2017 thestormdragon, I am not at all familiar with the include library you are using, but looking into the file you posted I see that you are not running the _ImageSearchStartup function, so it is very unlikely that the _ImageSearch call will ever work. The library also requires the ImageSearchDLLx32/64.dll and some C++ redistributables to be loadable - do you have these files available? They seem to be FileInstalled by the library - which implies that they are present in a compiled version of the library and not the simple script you posted. As to detecting this "error", are you sure that an image search is the best way? You appear to be using Excel and we have some real gurus here when it comes to interaction with that app. If you were to explain in more detail exactly what you are trying to do, with their help you may be able to find a more reliable way to achieve your aim. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
thestormdragon Posted February 17, 2017 Author Share Posted February 17, 2017 Hi Thanks for your reply. It wasn't so much that the _ImageSearch call is, or isn't, working but the fact that just having the #include statement stops my code completely - even the most basic script (display a message box) does nothing if that #include is there ; Script Start - Add your code below here #include <imagesearch2015.au3> msgbox(0,"Test","Test") I can confirm that the DLLs referred to are in place and being used (if they're not present then it complains when compiling, There's a couple of errors that I can see in the process 1) IE (which is 'hosting' a flash app) fails to download the file at all 2) The file appears to download but Excel says "unable to read file" in a dialog box that may or may not get the window focus I'll have a play with other ways of detecting the error and I'll bear the Excel/IE gurus in mind as well. Many thanks David Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now