• 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
NSScreen's screens() changed in Mojave
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSScreen's screens() changed in Mojave


  • Subject: NSScreen's screens() changed in Mojave
  • From: Gil Dawson via AppleScript-Users <email@hidden>
  • Date: Wed, 6 May 2020 19:07:17 -0700

Hi--

I used Migration Assistant to copy

from my 2009 MacBook Pro with El Capitan 10.11.6 onto

a newer 2015 MacBook Pro with Mojave 10.14.6.

Most applications work fine on my new computer, but this AppleScript (which, in
El Capitan, would put Finder windows on my laptop) does not:

use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use framework "AppKit"
use scripting additions

property zero : 0
property one : 1
property two : 2

property InterWindowGap : 15 -- gap between upper window and lower window

set theScreens to current application's NSScreen's screens()
if (count of theScreens) is not equal to two then
        display dialog "This app requires two screens." giving up after two
        return
end if

set LargerScreenSize to zero

repeat with aScreen in theScreens

        set thisScreensSize to ¬
                (width of |size| of (aScreen's frame as record)) * ¬
                (height of |size| of (aScreen's frame as record))  --> error

...
Result:
error "Can’t get |size| of {«class form»:«constant ****usrp», «class
want»:property, «class seld»:\"frame\", «class from»:item 1 of «class ocid» id
«data optr00000000005B770300600000» of «script»}." number -1728 from |size| of
{«class form»:«constant ****usrp», «class want»:property, «class seld»:"frame",
«class from»:item 1 of «class ocid» id «data optr00000000005B770300600000»}

Evidently something changed in Mojave.  Any idea what needs to change?


--Gil

 _______________________________________________
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: NSScreen's screens() changed in Mojave
      • From: Shane Stanley via AppleScript-Users <email@hidden>
  • Prev by Date: Re: AppleScript-Users Digest, Vol 17, Issue 56
  • Next by Date: Re: NSScreen's screens() changed in Mojave
  • Previous by thread: Re: AppleScript-Users Digest, Vol 17, Issue 56
  • Next by thread: Re: NSScreen's screens() changed in Mojave
  • Index(es):
    • Date
    • Thread