Moving the Cursor and Clicking in AppleScript

Does anyone know why this wouldn't seem to work? All that happens is that cursor stays where it is, and turns into an arrow. I don't think it's a permissions issue, and there are no errors in the log. Thank you.

tell application "System Events"
	tell process "iZotope RX 10"
		click at {1188, 978}
	end tell
end tell

I'm trying to test it myself. I'm not sure what it's doing, (I don't have your app so I have to change the app name) but I'm wondering why you aren't using Keyboard Maestro to move and click the mouse.

Because I'm pedantic, I'd like to point out that you are conflating the words "cursor" with "pointer". A pointer is the symbol on the screen that follows the mouse, (usually an arrow) while the cursor is the symbol on screen that moves when you type (usually a vertical bar.) Normally I don't mention this to people, but in your case I'm not sure which one you are talking about, so I have to mention this.

Thank you again for your helpful questions. Quite right on cursor and pointer—without being specific, it's impossible to help someone. Actually, I'm fascinated by this stuff, and have a feeling we've been to some of the same conferences.

I'm not using KM to move the cursor because the UI widgets I'm interacting with are under a Custom HTML window. Using AppleScript and setting the focus manually, most widgets aren't a problem—but there's one particular widget in RX10 that isn't right: it's static text that when clicked, dynamically creates a text field. (And I can grab the text field no problem.)

But before I can click under something, I need to figure out how to click at all! As far as I know, there's no AppleScript way of clicking on static text. Nor is there a way to click on a group.

UI Browser suggests this, which tells me where to click, and doesn't throw an error—but also doesn't appear to do anything

   tell static text "0"  of group 1 of group 1 of group 3 of window "Gtr Rhtym 1(4).wav" 
      set {xPosition, yPosition} to position
      set {xSize, ySize} to size
   end tell
   -- modify offsets if hot spot is not centered:
   click at {xPosition + (xSize div 2), yPosition + (ySize div 2)}

UI Browser suggests this to select the static text:

select static text "0" of group 1 of group 1 of group 3 of window "Gtr Rhtym 1(4).wav"

It seems like I should be able to do something useful with this information, but I don't know how. :joy:

Thank you again for your time and insight.

I probably can't give advice on this topic, but I did find a similar question on another site:

1 Like

Thank you – that took me down a rabbit hole that got me soooooo close! I'm almost there…

It's always appreciated when someone says that they appreciate your help. So thanks.

1 Like

Got it. Thanks again!