Does Eggplant record where it expects the image?

Two quick questions:

  1. If I record a double click on a desktop icon, does Eggplant (behind the scenes) store any coordinates with it? I realize, that you can reuse images and that it does a search for the image each time, but I was curious if Eggplant actually stores some data to speed up searches (ie a certain quadrant of the screen)

  2. Is there any way to view a more indepth version of what is being scripted. For example, if you have a click command on the start button, you are essentially saying if you find the start button, anywhere, click in this specific coordinate. It’d be nice to view or modify that coordinate.

Thanks.

[quote=“sygyzy”]Two quick questions:

  1. If I record a double click on a desktop icon, does Eggplant (behind the scenes) store any coordinates with it? I realize, that you can reuse images and that it does a search for the image each time, but I was curious if Eggplant actually stores some data to speed up searches (ie a certain quadrant of the screen)[/quote]

Yes, Eggplant records the coordinates of the upper-left corner of the capture area, but no, that information is not used during the playback of the script. Since for most searches Eggplant can search the entirety of even a large display several times a second, there’s not much need to speed up the searches. Eggplant spends most of its time waiting for the remote system to do something.

I’m not sure I understand what you’re saying. When Eggplant finds the image it is searching for, it clicks where the image is found – the original coordinates have nothing to do with it. If you want to see the information that is recorded for a specific image, you can just output the value of the imageInfo() function:

put imageInfo("MyImage")

If you want to see where a particular image is found on the screen, you can run this command:

put imageLocation("MyImage")

And if you want to see the coordinates where the last image was found, you can run this command:

put foundImageLocation()

Just a few additional tips.

To see the location of the original screen location when an image was capture you can do.


put imageInfo("MyImage")'s CaptureLocation

This information is currently NOT used as part of the image search but it might be used in the future.

Also if you want to “modify” the return location you can always use some simple vector math. For example, this will click 50 pixels to the right of the found image:


click imageLocation("MyImage")+(50,0)

Finally, you can restrict the search area using the setSearchRectangle command. Note: Always be sure to set it back to the full screen. An interesting idea would be to use the capture location yourself. This little example would click on an image BUT only within a 200,200 area around the upper left corner of the original capture location:


put imageInfo("MyImage")'s CaptureLocation into Original
setSearchRectangle (Original-(100,100),Original+(100,100))
click imageLocation("MyImage")
setSearchRectangle -- put it back to full screen

We wouldn’t recommend this logic for improved efficiency, Eggplant is usually quite fast at finding images but if it is important to the logic of your script then this works quite well.

Thanks for your replies. They are most helpful!