Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Mouse-position/AppleScript/mouse-position.applescript
Normal file
16
Task/Mouse-position/AppleScript/mouse-position.applescript
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
use framework "AppKit"
|
||||
|
||||
tell application id "com.apple.SystemEvents" to tell ¬
|
||||
(the first process where it is frontmost) to ¬
|
||||
set {x, y} to the front window's position
|
||||
|
||||
tell the current application
|
||||
set H to NSHeight(its NSScreen's mainScreen's frame)
|
||||
tell [] & its NSEvent's mouseLocation
|
||||
set item 1 to (item 1) - x
|
||||
set item 2 to H - (item 2) - y
|
||||
set coords to it as point
|
||||
end tell
|
||||
end tell
|
||||
|
||||
log coords
|
||||
Loading…
Add table
Add a link
Reference in a new issue