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

Re: NSScreen's screens() changed in Mojave


  • Subject: Re: NSScreen's screens() changed in Mojave
  • From: Shane Stanley via AppleScript-Users <email@hidden>
  • Date: Thu, 7 May 2020 12:44:17 +1000

On 7 May 2020, at 12:07 pm, Gil Dawson via AppleScript-Users
<email@hidden> wrote:
>
> 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?

This is something that changed in High Sierra -- see:
<https://latenightsw.com/high-sierra-applescriptobjc-bugs/> for details and
workarounds.

The short version is that NSRects get returned as a list of lists, rather than
as a record.

So the simplest for your code would be something like:

repeat with aScreen in theScreens
        set theFrame to aScreen's frame()
        set thisScreensSize to ¬
                (current application's NSWidth(theFrame)) * ¬
                (current application's NSHeight(theFrame))


--
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: NSScreen's screens() changed in Mojave
      • From: Gil Dawson via AppleScript-Users <email@hidden>
References: 
 >NSScreen's screens() changed in Mojave (From: Gil Dawson via AppleScript-Users <email@hidden>)

  • Prev by Date: NSScreen's screens() changed in Mojave
  • Next by Date: Excel problem solved
  • Previous by thread: NSScreen's screens() changed in Mojave
  • Next by thread: Re: NSScreen's screens() changed in Mojave
  • Index(es):
    • Date
    • Thread