Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do manipulate application windows

0 views
Skip to first unread message

pp

unread,
Mar 8, 2007, 1:12:05 AM3/8/07
to
Hi there,


I am new Mac user, but an experienced programmer. I know little about
Cocoa (for now) so I would appreciate your input on a small project I
have.

I want to build a small application, to be run on the background,
which can manipulate other applications windows, typically the Window
that is currently focused, when I invoke a certain keyboard sequence
(say Cmd something). It should go like this:

1. User presses Command Something
2. My background app picks that event and
3. Determines the currently focused window and
4. Moves/resizes the currently focused window

Can this be done? Can you give me some clue as to how? What API
should I investigate?

Thanks in advance,
-pp

Michael Ash

unread,
Mar 8, 2007, 6:59:12 AM3/8/07
to
pp <pedro....@gmail.com> wrote:
> 1. User presses Command Something
> 2. My background app picks that event and
> 3. Determines the currently focused window and
> 4. Moves/resizes the currently focused window
>
> Can this be done? Can you give me some clue as to how? What API
> should I investigate?

You'll want to check out the Accessibility API. Note that Accessibility
requires the user to enable it, and it's off by default. This is meant as
a security feature so that apps can't snoop on other apps without
permission.

--
Michael Ash
Rogue Amoeba Software

pp

unread,
Mar 8, 2007, 11:13:24 AM3/8/07
to
On Mar 8, 3:59 am, Michael Ash <m...@mikeash.com> wrote:

> You'll want to check out the Accessibility API. Note that Accessibility
> requires the user to enable it, and it's off by default. This is meant as
> a security feature so that apps can't snoop on other apps without
> permission.

Thank you. A quick google search did not reveal any code examples.
Anything you can point me to?

-pp

Michael Ash

unread,
Mar 8, 2007, 5:57:20 PM3/8/07
to

Limiting the search to apple.com gets various useful hits:

http://www.google.com/search?client=safari&rls=en&q=accessibility+sample+code+site:apple.com&ie=UTF-8&oe=UTF-8

Note that Accessibility is not a Cocoa API (except for a few bits and
pieces for allowing *other* programs to use Accessibility to manipulate
your app), so if you try to find a Cocoa example then you'll hit a dead
end.

pp

unread,
Mar 9, 2007, 12:55:59 AM3/9/07
to
Thanks for the pointer!

-pp

On Mar 8, 2:57 pm, Michael Ash <m...@mikeash.com> wrote:
> Limiting the search to apple.com gets various useful hits:
>

> http://www.google.com/search?client=safari&rls=en&q=accessibility+sam...

0 new messages