script dockIsShowing
set fudge to 10 -- allowance for hidden Dock
set screenWithMenu to current application's NSScreen's screens()'s objectAtIndex_(0)
set {x1, y1} to (screenWithMenu's visibleFrame()'s |size|()) as list
set {x2, y2} to (screenWithMenu's frame()'s |size|()) as list
if (x2 - x1) > fudge or (y2 - y1) > (22 + fudge) then -- 22 is standard menubar height
return true
end if
set {x3, y3} to current application's NSEvent's mouseLocation() as list
if (x3 > x1) or (y3 > y1) then -- mouse is beyond visible frame
return true
end if
return false
end script
tell application "ASObjC Runner" to set theResult to run the script {dockIsShowing} with result returned