New document with data from Services?
New document with data from Services?
- Subject: New document with data from Services?
- From: David Sinclair <email@hidden>
- Date: Sat, 3 Aug 2002 17:40:56 -0700
I'm read the documentation, and searched on mamasam.com, but can't
find an answer to the following.
I have a NSDocument-based application, and am trying to add a Service
to it to open a new document with the selected text. What I can't
figure out is how to both call newDocument: to open the document
window, and insert the text into the new text view.
I can call newDocument: via the following from the Services handler
method, but how do I then get the data into the text view?
[[NSDocumentController sharedDocumentController] newDocument:self];
Or I can create a new instance of the window controller and insert
the text, but how do I do the setup stuff that newDocument: does?
I have to believe that there is an easy way to do this that I'm
missing. Any pointers would be appreciated!
Also, while I'm at it: it does the right thing when the app is
already running, but if the Service action launches the app, it
creates a second new document (in addition to the usual one on
launch). Is there any way I can just use the default untitled
document in this case?
--
David Sinclair - email@hidden
http://www.dejal.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.