mouse scroll down or up

The reference manual says scrollWheelDown <amountToScroll>..should work
Basically,I have a popup chat window which comes up and there is an image to be recognized by scrolling the mouse down .I tried sending pagedown command but that doesn't work on that window.

Comments

  • Generally, anything that works in live mode should be scriptable. Check to see if the scroll wheel on your mouse is capable of scrolling the window before you attempt to script it. You should also be aware of what condition is required in order to send the scroll to the appropriate control on your interface. Some controls for example, require that they be in focus before they can respond to actions. For that reason it is often necessary to click within the scrollable area or have the mouse pointer within the scrollable area to get the scroll to work.

    If all else fails try scripting a drag on the scroll slider in small increments. This will require that you capture a unique image of the slider. Once you have the appropriate image of the slider captured, you can manipulate the slider in small increments by using image coordinates.

    Here's an example:
    put imagelocation("slider") into coord
    draganddrop coord, coord + (0,10)   -- drag 10 pixels in the y direction
    
  • When trying to run this code:
    put imagelocation("slider") into coord
    repeat until imagefound("atBottom")
    	drag coord,coord + (0,10) -- drag 10 pixels in the y direction 
    end repeat
    

    I get an error drag called with absolute point(114,50) and other parameters

    Any suggestions on why this is not working?
  • EggplantMattEggplantMatt ForumAdmin admin
    The drag command takes a single coordinate value or a list of images, not a list of coordinates. The list of images is an implicit "any", letting eggPlant start the Drag with the first image it finds. What you will want to do is a Drag followed by a Drop, but you'll also want to update the value of coord or eggPlant will do the same drag over and over:
    put imagelocation("slider") into coord
    repeat until imagefound("atBottom")
    	drag coord
    	add (0, 10) to coord
    	drop coord -- drag 10 pixels in the y direction
    end repeat
    
  • Brilliant!!! Thanks Matt it works :)
Sign In or Register to comment.