Professional Web Applications Themes

some sample code needed..ASAP.. - Mac Programming

Hi, I am developing a Carbon Application using Project Builder which comes with Mac OS X 10.1 version. I am trying to make use of Apple Events. One of my basic ideas is to establish interprocess communication. For this I suppose we have to make use of Event Manager and to use High-Level events. When I run my Carbon Application and my mouse is over another application, I wanted to get the title of that particular application rather window title. Pls can anyone send me a concrete sample code as early as possible. Thanks in advance.. Gopal Srinivasan....

  1. #1

    Default some sample code needed..ASAP..

    Hi,

    I am developing a Carbon Application using Project Builder which comes
    with Mac OS X 10.1 version. I am trying to make use of Apple Events.

    One of my basic ideas is to establish interprocess communication. For
    this I suppose we have to make use of Event Manager and to use
    High-Level events.

    When I run my Carbon Application and my mouse is over another
    application, I wanted to get the title of that particular application
    rather window title.

    Pls can anyone send me a concrete sample code as early as possible.

    Thanks in advance..

    Gopal Srinivasan.
    gops Guest

  2. #2

    Default Re: some sample code needed..ASAP..

    On 23 Sep 2003, gops wrote:
    > Hi,
    >
    > I am developing a Carbon Application using Project Builder which comes
    > with Mac OS X 10.1 version. I am trying to make use of Apple Events.
    >
    > One of my basic ideas is to establish interprocess communication. For
    > this I suppose we have to make use of Event Manager and to use
    > High-Level events.
    >
    > When I run my Carbon Application and my mouse is over another
    > application, I wanted to get the title of that particular application
    > rather window title.
    I doubt you will be able to get events telling you that. You might have
    some luck with the accessibility framework, but that was only added in
    10.2

    Fred
    >
    > Pls can anyone send me a concrete sample code as early as possible.
    >
    > Thanks in advance..
    >
    > Gopal Srinivasan.
    >
    Frederick Cheung Guest

  3. #3

    Default Re: some sample code needed..ASAP..

    Hi there,

    Thanks for your response fred. But 10.1 version does support
    InterProcess Application and also high-level and Event manager. So it
    should be and it is possible to develop such type of application.

    Can you, from any other source find a concrete solution. Pls consider
    this as very urgent.

    With regards

    Gopal Srinivasan.
    gops Guest

  4. #4

    Default Re: some sample code needed..ASAP..

    In article <19fcd2f0.0309242119.1137a3d4posting.google.com >,
    [email]gopal_srinihotmail.com[/email] (gops) wrote:
    > Thanks for your response fred. But 10.1 version does support
    > InterProcess Application and also high-level and Event manager. So it
    > should be and it is possible to develop such type of application.
    >
    > Can you, from any other source find a concrete solution. Pls consider
    > this as very urgent.
    You could march down the list of processes, Using AESend() to ask each
    process for its windows, then ask for the bound box of each window, but
    only Cocoa applications and properly written PowerPlant applications
    would reply to the appleEvent. Expect the whole process to take a few
    seconds. A large fraction of applications are neither Cocoa, nor
    scriptable PowerPlant apps.

    What exactly are you trying to do?
    David Phillip Oster Guest

  5. #5

    Default Re: some sample code needed..ASAP..

    On Thu, 25 Sep 2003, David Phillip Oster wrote:
    > In article <19fcd2f0.0309242119.1137a3d4posting.google.com >,
    > [email]gopal_srinihotmail.com[/email] (gops) wrote:
    >
    > > Thanks for your response fred. But 10.1 version does support
    > > InterProcess Application and also high-level and Event manager. So it
    > > should be and it is possible to develop such type of application.
    > >
    > > Can you, from any other source find a concrete solution. Pls consider
    > > this as very urgent.
    >
    > You could march down the list of processes, Using AESend() to ask each
    > process for its windows, then ask for the bound box of each window, but
    > only Cocoa applications and properly written PowerPlant applications
    > would reply to the appleEvent. Expect the whole process to take a few
    > seconds. A large fraction of applications are neither Cocoa, nor
    > scriptable PowerPlant apps.
    >
    And even when this does work, the OP would still need to find the
    Z-ordering of all these windows). It may be easier to try and talk
    directly with the window server.

    Fred
    > What exactly are you trying to do?
    >
    Frederick Cheung Guest

  6. #6

    Default Re: some sample code needed..ASAP..

    In article <19fcd2f0.0309242119.1137a3d4posting.google.com >,
    [email]gopal_srinihotmail.com[/email] (gops) wrote:
    > Hi there,
    >
    > Thanks for your response fred. But 10.1 version does support
    > InterProcess Application and also high-level and Event manager. So it
    > should be and it is possible to develop such type of application.
    Does not follow. Apple Events only allow you to get information which
    the writer of the application decided to handle. Often, but not always,
    this is commands like 'open' and 'quit', and sometimes a list of
    doents and their properties, and pretty much never a command like
    'the title of the window under the mouse cursor'.
    > Can you, from any other source find a concrete solution. Pls consider
    > this as very urgent.
    You're going to have to do some hacking, either with APE (is that even
    supported under 10.1?) or with the window server. There is no official
    way to do what you need done, period.
    Michael Ash Guest

  7. #7

    Default Re: some sample code needed..ASAP..

    In article
    <Pine.LNX.4.44.0309250802540.16445-100000kern.srcf.societies.cam.ac.uk>
    ,
    Frederick Cheung <fglc2srcf.DUH.ucam.org> wrote:
    > And even when this does work, the OP would still need to find the
    > Z-ordering of all these windows). It may be easier to try and talk
    > directly with the window server.
    Look at LApplication::GetSubModelByPosition(). An application that
    includes PowerPlant's built-in appleEvent support _does_ give you the
    windows in Z-order. Example (in AppleScript):

    tell application "CodeWarrior IDE"
    windows
    end tell


    returns an AEList of AEDescriptors for the windows, in Z order.
    David Phillip Oster Guest

  8. #8

    Default Re: some sample code needed..ASAP..

    On Thu, 25 Sep 2003, David Phillip Oster wrote:
    > In article
    > <Pine.LNX.4.44.0309250802540.16445-100000kern.srcf.societies.cam.ac.uk>
    > ,
    > Frederick Cheung <fglc2srcf.DUH.ucam.org> wrote:
    >
    > > And even when this does work, the OP would still need to find the
    > > Z-ordering of all these windows). It may be easier to try and talk
    > > directly with the window server.
    >
    > Look at LApplication::GetSubModelByPosition(). An application that
    > includes PowerPlant's built-in appleEvent support _does_ give you the
    > windows in Z-order. Example (in AppleScript):
    >
    > tell application "CodeWarrior IDE"
    > windows
    > end tell
    >
    >
    > returns an AEList of AEDescriptors for the windows, in Z order.
    Yes, but in OS X, windows from different applications can be interleaved.
    You'd need to do more work to get the overall Z-ordering of the windows.

    Fred

    Frederick Cheung Guest

  9. #9

    Default Re: some sample code needed..ASAP..

    In article
    <Pine.LNX.4.44.0309251758380.15266-100000kern.srcf.societies.cam.ac.uk>
    ,
    Frederick Cheung <fglc2srcf.DUH.ucam.org> wrote:
    > On Thu, 25 Sep 2003, David Phillip Oster wrote:
    > > returns an AEList of AEDescriptors for the windows, in Z order.
    > Yes, but in OS X, windows from different applications can be interleaved.
    > You'd need to do more work to get the overall Z-ordering of the windows.

    Oops. You are, of course, completely right. More old habits for me to
    unlearn.

    Thank you.

    David Phillip Oster
    David Phillip Oster Guest

  10. #10

    Default Re: some sample code needed..ASAP..

    Hi to all.. Thanks for your replies.

    But is this as difficult as you people are replying ?

    Why then the same thing is easy in windows rather microsoft
    applications.

    I mean you have a MFC Exe with some command button and some code which
    will grab the text over a word doent ( Using OLE Automation) and
    also from html file ( using Type libraries of IE..tlbs)

    When i launch my MFC, i point the mouse over some word donet text
    and I get that text displayed in alert box when or edit control on my
    MFC Exe..

    Thanks for replies..

    Always open to suggestions and any help ?

    Gopal.
    gops Guest

  11. #11

    Default Re: some sample code needed..ASAP..

    On 25 Sep 2003, gops wrote:
    > Hi to all.. Thanks for your replies.
    >
    > But is this as difficult as you people are replying ?
    try it and find out.
    >
    > Why then the same thing is easy in windows rather microsoft
    > applications.
    AppleEvents provide you with a way of communicating with other
    applications. Like in real life though, they are free to ignore your
    requests. For some reason it became standard for windows apps to answer
    the request you mention.
    >
    > I mean you have a MFC Exe with some command button and some code which
    > will grab the text over a word doent ( Using OLE Automation) and
    > also from html file ( using Type libraries of IE..tlbs)
    >
    > When i launch my MFC, i point the mouse over some word donet text
    > and I get that text displayed in alert box when or edit control on my
    > MFC Exe..
    >
    That's not quite the same think at what you are asking. If the text were
    selected, you could send the
    application a copy apple event, which would place the text in the
    clipboard. You could then paste that into your application.


    Fred
    > Thanks for replies..
    >
    > Always open to suggestions and any help ?
    >
    > Gopal.
    >
    Frederick Cheung Guest

Similar Threads

  1. sample timecard type code needed
    By jbyrd4k in forum Macromedia ColdFusion
    Replies: 0
    Last Post: March 30th, 03:20 AM
  2. Help needed. Please reply asap.
    By TCC_GirL webforumsuser@macromedia.com in forum Macromedia Freehand
    Replies: 2
    Last Post: February 9th, 07:01 PM
  3. My topic disappeared. urgent reply needed asap.
    By TCC_GirL in forum Macromedia Freehand
    Replies: 3
    Last Post: February 9th, 04:50 PM
  4. Using Net::FTP for chmod (help needed ASAP)
    By Jeff Westman in forum PERL Beginners
    Replies: 3
    Last Post: November 15th, 05:11 PM
  5. Pr0grammer Needed ASAP for News Ticker
    By Strato in forum Macromedia Flash Sitedesign
    Replies: 0
    Last Post: September 16th, 02:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139