How to capture image in specific area?

I would like to capture a text image in the pop up New dialog box by using SearchRectangle function. But i fail to get the text image caption location.


my code:
Click (Text:"New", TextStyle:"WindowTitle")
put ImageInfo(Text:"New", TextStyle:"WindowTitle")

put (ImageInfo(Text:"New", SearchType:"Text&Pulsing", TextStyle:"WindowTitle")'s CaptureLocation) into UpperLeft


output:
click Text: New at (350, 143)
((CaptureLocation:(0,0), HotSpot:(12,5), ImageName:"Text: New", ImageSize:(25,11), ImageTolerance:"60", Pulsing:"false", SearchType:"Text"))

I'm wondering why the CaptureLocation is (0,0) and not (350, 143)? May i know how do i get the pop up New Dialog box's location?

Comments

  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    What you want is the foundImageLocation:
    Click (Text:"New", TextStyle:"WindowTitle") 
    put foundImageLocation()
    
    The foundImageLocation function returns the location of the hotSpot on the screen for the last image that was found. Keep in mind that this location will normally be the center of the text, not the top left. If you want the top left corner you can specify the hotSpot in your text image:
    Click (Text:"New", TextStyle:"WindowTitle", HotSpot:(0,0)) 
    put the foundImageLocation into upperLeft
    
Sign In or Register to comment.