• 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: Finder window - coordinates and screen?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder window - coordinates and screen?


  • Subject: Re: Finder window - coordinates and screen?
  • From: "Finlay Dobbie" <email@hidden>
  • Date: Mon, 25 Jun 2007 18:19:02 +0100

On 24/06/07, b UND d <email@hidden> wrote:
- is there a better/other way than using an NSAppleScript like this?

NSAppleScript *fmostWindow = [[NSAppleScript alloc]
initWithSource:@"tell application \"Finder\" to get bounds of window
1"];

Well, you'll be better off using a precompiled script, since you won't experience a brief pause as OSA compiles it to AppleEvents.

- if not: how do I convert the resulting AppleScript coordinates in
cocoa coordinates and an info on which screen the Finder window
origin is?

I can't say I know offhand. You'll probably get a string back from AppleScript, you'll probably want to parse that into a few floating point numbers, then do the usual jiggery pokery to translate the coordinate bases.

-- Finlay
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Finder window - coordinates and screen?
      • From: Uli Kusterer <email@hidden>
References: 
 >Finder window - coordinates and screen? (From: b UND d <email@hidden>)

  • Prev by Date: Re: int to NSString?
  • Next by Date: Shared code in multiple plug-ins.
  • Previous by thread: Finder window - coordinates and screen?
  • Next by thread: Re: Finder window - coordinates and screen?
  • Index(es):
    • Date
    • Thread