Re: Is dock visible
Re: Is dock visible
- Subject: Re: Is dock visible
- From: Robert Poland <email@hidden>
- Date: Sun, 11 Dec 2011 07:36:22 -0700
On Dec 11, 2011, at 12:29 AM, Shane Stanley wrote: On 11/12/2011, at 3:26 PM, Michelle Steiner wrote: The only way to programmatically determine whether the Dock is hidden is to check to see whether it is hideable, and to check whether the mouse pointer is in the zone.
Like for instance:
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
I tried to explore Shane's example…
Even after I found and installed ASObjC Runner it won't compile. Got errors on "frame()'s" and "returned".
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