• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
click at under Mavericks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

click at under Mavericks


  • Subject: click at under Mavericks
  • From: "koenig.yvan" <email@hidden>
  • Date: Thu, 02 Jan 2014 18:04:01 +0100

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.

Yvan KOENIG (VALLAURIS, France) jeudi 2 janvier 2014 18:03:56



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: click at under Mavericks
      • From: Bill Cheeseman <email@hidden>
    • Re: click at under Mavericks
      • From: Axel Luttgens <email@hidden>
    • Re: click at under Mavericks
      • From: Christopher Stone <email@hidden>
    • Re: click at under Mavericks
      • From: Robert Poland <email@hidden>
  • Prev by Date: Happy new year
  • Next by Date: Re: click at under Mavericks
  • Previous by thread: Happy new year
  • Next by thread: Re: click at under Mavericks
  • Index(es):
    • Date
    • Thread