Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: communicating between users
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: communicating between users



On Aug 16, 2005, at 9:13 PM, Scott Lindsey wrote:

Have you tried typeApplicationURL?

I haven't actually stuck together the code and tried this, though.


Here's some rough proof-of-concept code that worked for me.  I had BBEdit running under a second user (UID 502, PID 25105).  After authenticating with an admin account, I got back a reply event with the proper value (number of documents) in it.

    OSStatus err;
    AppleEvent ae, reply;
    AEAddressDesc target;
    AEDesc param;
    char* url;

    

    url = "">"eppc://127.0.0.1/BBEdit?uid=502&pid=25105";

    

    err = AECreateDesc(typeApplicationURL, url, strlen(url), &target);
    if (!err)
        err = AECreateAppleEvent(kAECoreSuite, kAECountElements, &target, kAutoGenerateReturnID, kAnyTransactionID, &ae);
    if (!err)
    {
        DescType docType = cDocument;
        err = AECreateDesc(typeType, &docType, sizeof(docType), &param);
    }
    if (!err)
        err = AEPutParamDesc(&ae, keyAEObjectClass, &param);
    if (!err)
        err = AESendMessage(&ae, &reply, kAEWaitReply, kAEDefaultTimeout);

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: communicating between users (From: Matt Neuburg <email@hidden>)
 >Re: communicating between users (From: Scott Lindsey <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.