title: How to get the coordinates of an image in Sikuli?
body: <p>I have this GUI on our project (please bear with my illustration, I'm not allowed to take a screenshot at work)</p>
  
  <pre><code>----------------------------------------------
      (1)     Header                            |
  ----------------------------------------------|
               (2)      Files             | (3) | Drop-down button (Options)
  ----------------------------------------|-----|          
                                          |     |
  ----------------------------------------|-----|
                                          |     |
  ----------------------------------------|-----|
                                          |     |
  -----------------------------------------------
  </code></pre>
  
  <p>I need to test one file in each file type our product can support.
  The ultimate goal is to use that (3) drop down button.
  Here is the summary of my code when I'm in this part</p>
  
  <pre><code>find_filetype = find.imagedict(filetypeicon.png) #(2) filetype
  
  freg = find_filetype.right()
  
  if freg.exists(drop-down.png):                   #(3) drop-down icon
      freg.click(drop-down.png)
  </code></pre>
  
  <p>Now after clicking (3), a drop-down menu with 4 action items will appear.
  So for example if I click (3a): it will appear below from (3b - 3d) showing at least 2-3 drop-down items.</p>
  
  <pre><code>----------------------------------------------
              Header                            |           
  ----------------------------------------------|
                                          | (3a)|
  ----------------------------------------------|
                                  |  (a1)   |   |   #a1 = action 1
  --------------------------------|---------|---|   
                                  |  (a2)   |   |   #a2 = action 2
  --------------------------------|---------|---|
                                  |__(a3)___|   |
  -----------------------------------------------
  </code></pre>
  
  <p>If I click (3c):
  The drop-down menu will choose to appear above (f.a.d.)
  Showing at least 2 drop-down items.</p>
  
  <pre><code>----------------------------------------------
              Header                            |           
  ----------------------------------------------|
                                  |  (a1)   |   |
  --------------------------------|---------|---|         
                                  |  (a2)   |   |
  --------------------------------|_________|---|
                                          | (3c)|           
  ----------------------------------------|-----|
                                          |     |
  ----------------------------------------------
  </code></pre>
  
  <p>My workaround for this are :</p>
  
  <ol>
  <li><p>screenshot all action items and </p></li>
  <li><p>if/elifs + dragDrop()</p></li>
  </ol>
  
  <p>which makes my scripts <strong>slow</strong> <em>(I perform hundred of iterations everyday)</em></p>
  
  <p>Is there a way I can find (a1) <em>(because its always present after clicking (3))</em>, save its coordinates and use it as a param for scrolldown_codes like this</p>
  
  <pre><code>   #after clicking drop-down
     #find and get (action1) coordinates
     def scroll_down(coordinates):              #pass it here
         while not exist(action(n).png):        #n = action choice 
            end_Y = coordinates
            start_Y = coodinates - few_Y
            dragdrop(start_Y, end_Y)
            wait(1)
         click(action(n).png)
  </code></pre>
  
  <p>Please help me! Feel free to suggest anything helpful!</p>
  
  <p>Note: Im only allowed to click and drag while on that GUI because its a touchscreen product we're developing. </p>