thestormdragon

#include imagesearch2015 stops my script

3 posts in this topic

#1 ·  Posted (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 by thestormdragon

Share this post


Link to post
Share on other sites



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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now