• 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: Window Swap Code Broken in High Sierra?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Window Swap Code Broken in High Sierra?


  • Subject: Re: Window Swap Code Broken in High Sierra?
  • From: Jim Mitchell <email@hidden>
  • Date: Thu, 10 Aug 2017 08:07:17 -0700

Hi Brian...

That was my first assumption and give it a shot, but ended up with the same
result. The error looks to me that the list property can't be read for one
reason or another.

On Thu, Aug 10, 2017 at 7:37 AM, Brian Christmas <email@hidden> wrote:

> G’day Jim
>
> In a preliminary test of my App, I found the same problem, but did not
> have time to get back to it, too many alterations required for 10.12 as it
> was, and I’m still going.
>
> However, I’ve been wondering if the word ‘origin' now needs piping i.e.
> |origin|
>
> Santa
>
>
>
> On 11 Aug 2017, at 12:04 am, Jim Mitchell <email@hidden> wrote:
>
> Hi all,
>
> I'm finding that the code included below, lifted pretty much verbatim from
> the AppleScript ObjC Explored 5 resource by Shane no longer works under
> macOS High Sierra. I've not had a ton of time to dig into, but when calling
> the method from another (the main app method), I get the following error:
>
> *** -[YasuAppDelegate doTheMagic:]: Can’t get origin of {{0.0, 0.0},
> {500.0, 282.0}}. (error -1728)
>
> The code works like a champ under 10.11 and 10.12, but not 10.13. I'm
> curious to know if anyone else is seeing this in their app, and if so, what
> did you do to correct? Or, if you see the solution I'm missing, please
> point me in the right direction.
>
> Thanks!
>
> Code snippet:
>
> -- animate view swaps
> on animateView(theView) -- calling from another method, not a sender...
> set theFrame to theView's frame()
> tell my mainWindow
> set theFrame to its frameRectForContentRect:theFrame
> -- *** next line is where code breaks and won't continue... ***
> set {origin:{x:frameX, y:frameY}, |size|:{width:frameWidth,
> height:frameHeight}} to theFrame
> set {origin:{x:windowX, y:windowY}, |size|:{width:windowWidth,
> height:windowHeight}} to its frame()
> set newOrigin to {x:windowX - (frameWidth - windowWidth) / 2, y:windowY -
> frameHeight + windowHeight}
> set newFrame to {origin:newOrigin, |size|:{width:frameWidth,
> height:frameHeight}}
> set newFrame to my adjustFrame:newFrame forScreenOfWindow:mainWindow
> its setContentView:blankView
> its setFrame:newFrame display:true animate:true
> its setContentView:theView
> end tell
> end animateView
>
> -- adjust frame for view swap
> on adjustFrame:proposedFrame forScreenOfWindow:aWindow
> set {origin:{x:windowX, y:windowY}, |size|:{width:windowWidth,
> height:windowHeight}} to proposedFrame
> set screenFrame to aWindow's screen()'s visibleFrame()
> set {origin:{x:frameX, y:frameY}, |size|:{width:frameWidth,
> height:frameHeight}} to screenFrame
> if windowX < frameX then set windowX to frameX
> if windowX + windowWidth > frameX + frameWidth then set windowX to frameX
> + frameWidth - windowWidth
> if windowY < frameY then set windowY to frameY
> return {origin:{x:windowX, y:windowY}, |size|:{width:windowWidth,
> height:windowHeight}}
> end adjustFrame:forScreenOfWindow:
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> applescriptobjc-dev mailing list      (email@hidden
> )
> Help/Unsubscribe/Update your Subscription:
> 40gmail.com
>
> This email sent to email@hidden
>
>
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Window Swap Code Broken in High Sierra? (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: Window Swap Code Broken in High Sierra?
  • Next by Date: Re: Window Swap Code Broken in High Sierra?
  • Previous by thread: Re: Window Swap Code Broken in High Sierra?
  • Next by thread: Re: Window Swap Code Broken in High Sierra?
  • Index(es):
    • Date
    • Thread