• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [applescript] zoomed attribute of tabbed fullscreen windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: [applescript] zoomed attribute of tabbed fullscreen windows
      • From: 2551phil <email@hidden>
References: 
 >zoomed attribute of tabbed fullscreen windows (From: Jean-Christophe Helary <email@hidden>)
 >Re: [applescript] zoomed attribute of tabbed fullscreen windows (From: 2551phil <email@hidden>)

  • Prev by Date: Re: [applescript] zoomed attribute of tabbed fullscreen windows
  • Next by Date: Re: [applescript] zoomed attribute of tabbed fullscreen windows
  • Previous by thread: Re: [applescript] zoomed attribute of tabbed fullscreen windows
  • Next by thread: Re: [applescript] zoomed attribute of tabbed fullscreen windows
  • Index(es):
    • Date
    • Thread