• 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
Checking whether a Terminal window/tab is in fullscreen...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Checking whether a Terminal window/tab is in fullscreen...


  • Subject: Checking whether a Terminal window/tab is in fullscreen...
  • From: Jean-Christophe Helary <email@hidden>
  • Date: Fri, 09 Feb 2018 22:20:25 +0900

I think Shane mentioned a while ago that windows/tabs properties were not
updated unless they were put to the front, hence the difficulty to check
whether a tab is really in fullscreen or not, except if you force the update
before the check :)

set {fullWidth, fullHeight, myBounds, fullScreen} to {115, 35, {0, 0, 1280,
800}, true}

tell application "Terminal"
        if number of windows = 0 then set fullScreen to false
        repeat with myWindow in windows
                tell myWindow
                        set its frontmost to true
                        if its number of rows is less than fullHeight or its
number of columns is less than fullWidth or its bounds is not myBounds then set
fullScreen to false
                end tell
        end repeat
end tell

return {fullScreen}

With that routine, I get a correct result any time I run it.
The only remaining issue I have (not really important but it would be more
elegant to be able to solve it) is to detect if 2 sets of tabbed windows are in
different spaces so as to merge them (although I guess I could force-merge all
the tabs and be done with it). The thing is that I really can't find anything
that hints at whether the tabs are in the same space or not...


Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune


 _______________________________________________
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

  • Prev by Date: Re: text selection in general...
  • Next by Date: How do we make hierarchial menu?
  • Previous by thread: Re: text selection in general...
  • Next by thread: How do we make hierarchial menu?
  • Index(es):
    • Date
    • Thread