Re: NSScreen's screens() changed in Mojave
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