How do you write the command to carry out a double click with a mouse at a specific location in AppleScript?
Asked
Active
Viewed 7,754 times
2 Answers
3
You can use AppleScript to click twice using click at
and a delay.
tell application "System Events"
click at {10, 10}
delay 0.1
click at {10, 10}
end tell

grg
- 201,078
0
I'm afraid, double clicks no longer work if you run "El capitan"...
System Events' sdef file says "click at"s must be sent to a process object. This certainly includes buttons, menus, their items & some others, but not even (e.g.) objects visible on your desktop ...
As clicks on UI elements usually demand only one click, double clicks seem to be obsolete in AppleScript (for now).

clemsam lang
- 1,132
error "System Events got an error: Can’t make {10, 10} into type list." number -1700 from {10, 10} to list
– njboot Jun 08 '14 at 00:56tell application "UVIWorkstation" click at {455, 149} delay 0.1 click at {455, 149} end tell
leads to error "UVIWorkstation got an error: Can’t continue click." number -1708
I am having real trouble using the Ask Different editor. Every time I hit return it throws me out. Ray
– Ray d'Inverno Jun 09 '14 at 15:16Are you abel to place the left hand corner of one finder window on the desktop in the middle of the icon for an rtf file, then find its position with
tell application "Finder" to get the position of the front Finder window
which gives you coordinates (x,y) and then open it with your double click program.
Thanks for your help. If I can get this working then I should be able to do everything else I need.
Ray
– Ray d'Inverno Jun 11 '14 at 14:20click at
on Mavericks. It works again on Yosemite. – Matthieu Riegler Oct 17 '14 at 17:03