Re: How to send myself an AppleEvent?
Re: How to send myself an AppleEvent?
- Subject: Re: How to send myself an AppleEvent?
- From: Mike Abdullah <email@hidden>
- Date: Tue, 28 Feb 2006 09:56:08 +0000
It would probably be easier just to use a small NSAppleScript and
execute that. try something like:
activate application "myApp"
Where myApp is the name of your application. However | am slightly
confused as to what else you want. Are you basically trying to
simulate the act of the user clicking on the dock icon for your app?
If so, and you want to open a new doc, simply do something like this
after running the script:
if ([[[NSDocumentController sharedDocumentController] documents]
count] == 0)
[[NSDocumentController sharedDocumentController]
openUntitledDocumentAndDisplay: YES error: nil]
openUntitledDocAndDisplay is only available in 10.4, but there is a
10.3 and earlier equivalent.
Mike.
On 27 Feb 2006, at 18:07, Pierre Bernard wrote:
Hi!
I want my application to send itself an AppleEvent.
Specifically I have a document based application that I want to
send a reopen event so it becomes active and creates a new document
as needed.
I came across some Carbon functions and one hardly documented Cocoa
method. Nothing I can make much sense of. Yet I figure sending an
AppleEvent ought to be something easy.
TIA for your help
Pierre _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-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.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden