Re: click at under Mavericks
Re: click at under Mavericks
- Subject: Re: click at under Mavericks
- From: Robert Poland <email@hidden>
- Date: Thu, 02 Jan 2014 10:53:59 -0700
Yvan,
Just to add to the confusion;
My script applies to most all windows, not just TextEdit.
The line and all variations of it
tell application "System Events" to tell me to do shell script "/usr/bin/cliclick c:" & x & "," & y
Works well if run from Applescript Editor BUT only moves, does not click, when run as an app from a shortcut key.
The line
tell application "ASObjC Runner" to click button once at {x, y}
seems to work well in all cases.
On Jan 2, 2014, at 10:04 AM, koenig.yvan <email@hidden> wrote:
> 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
> 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
Robert Poland - Fort Collins, CO
_______________________________________________
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