Mavericks simple click bug

The following code executes correctly in OSX 10.7.5 and gives an error in 10.9.1

tell application "System Events" to tell process "Finder" to click at {100, 100}

What error are you getting ?

Here, 10.9.1 in French I get :

error “Erreur dans System Events : Il est impossible de rendre {302, 106} en type list.” number -1700 from {302, 106} to list

I already wrote about this kind of error in applescript-users@lists.apple.com.

Here is my message :

[i]Hello

I’m surprised by an odd behavior.
I was asked about the way to click somewhere in a script.
So I wrote a short script offering different ways to do the trick and tested it under 10.9.1.

activate application “TextEdit”
tell application “System Events” to tell (first process whose frontmost is true)
tell first window
keystroke “p” using {command down}
repeat
delay 0.1
if exists sheet 1 then exit repeat
end repeat
tell sheet 1
set {x, y} to get position of first menu button as list
# click at {x, y} # (1) fails
→ 10.8.5 : error missing value
→ 10.9.1 : error “Erreur dans System Events : Il est impossible de rendre {243, 680} en type list.” number -1700 from {243, 680} to list
click first menu button # works well
# tell first menu button to perform action “AXPress” # works well
# tell me to do shell script “/usr/bin/cliclick c:” & x & “,” & y # works well
# tell application “ASObjC Runner” to click button once at {x, y} # works well
end tell
end tell
# click at {x, y} # (2)
→ 10.8.5 : works well
→ 10.9.1 : error “Erreur dans System Events : Il est impossible de rendre {243, 680} en type list.” number -1700 from {243, 680} to list
end tell

I was really puzzled when I discovered that the standard instruction click at {x, y} failed with :
→ error “Erreur dans System Events : Il est impossible de rendre {243, 680} en type list.” number -1700 from {243, 680} to list

I decided to test under 10.8.5.
When the instruction was in the block tell first window (1), it issued an error missing value
When it was out of the block (2), it worked flawlessly.

So I returned to 10.9.1 and when the instruction is out of the block (2), it fails exactly as it does in the block (1).

Would be fine to know if you get the same behavior on your machines.[/i]

Yvan KOENIG (VALLAURIS, France) lundi 3 février 2014 20:17:32

Ivan,

Thank you for the reply and confirmation.

I’ve modified my code to the following:

tell application "System Events" to tell process "Script Editor" to click at {100, 100}

Here is the error I get:

error “System Events got an error: Can’t make {100, 100} into type list.” number -1700 from {100, 100} to list

I think we are seeing the same error.

I do not have a computer is 10.8 installed. I have two computers with 10.7.5 and they run this code successfully.

As Apple may need years to correct this anomaly, it may be a good idea to go to :
http://www.bluem.net/en/mac/cliclick/

and download the Unix command cliclick.

Here it’s installed at /usr/bin/cliclick

/usr/bin/cliclick -h
display its manual.

Yvan KOENIG (VALLAURIS, France) lundi 3 février 2014 21:44:43