Re: [applescript] zoomed attribute of tabbed fullscreen windows
Re: [applescript] zoomed attribute of tabbed fullscreen windows
- Subject: Re: [applescript] zoomed attribute of tabbed fullscreen windows
- From: Shane Stanley <email@hidden>
- Date: Sat, 14 Oct 2017 22:35:51 +1100
On 14 Oct 2017, at 5:51 pm, 2551phil <email@hidden> wrote:
>
> A slightly less-rough ānā ready version:
I suspect you're complicating things, in that, as far as I can see, in full
screen mode the front window has to be full screen, so there's no need to check
any others.
And it looks like the only way the top coordinate can be 0 is in full screen
mode, so:
tell application "Terminal" to set fullScreen to item 2 of (get position of
window 1) = 0
That should also catch cases of split full screen.
For multiple screens it's going to be more complex. Something like this would
work:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use framework "AppKit"
use scripting additions
set screenRects to current application's NSScreen's screens()'s
valueForKeyPath:"frame"
tell application "Terminal" to set theHeight to item 2 of (get size of window 1)
set fullScreen to false
repeat with aRect in screenRects
if current application's NSHeight(aRect) = theHeight then
set fullScreen to true
exit repeat
end if
end repeat
But other apps would need something quite different. TextEdit, for example,
gives the top as 24 points below the top of the screen (which is one more than
the depth of the hidden menu bar).
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
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