• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Standalone services
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Standalone services


  • Subject: Standalone services
  • From: David Albert <email@hidden>
  • Date: Fri, 18 Apr 2003 03:31:13 -0400

Hey,
I'm trying to learn how to make standalone services (i.e., services that are not offered by an application, but are just in the service menu. As an example to let me learn the basics, I'm trying to create a service that takes selected text and then calls NSRunAlertPanel with the selected text as the message content.

I have read the articles on developer.apple.com, as well as www.cocoadev.com, and I have a pretty good understanding of how to implement services through an application (for example, I understand it well enough to, given enough time create a program with a service that takes selected text and pastes it into a text box in the program). Information is sparse however on how to create a standalone service.

From what I can gather, you have to create a bundle with the proper settings in the Info.plist file. I also know rename the bundle to name.service and to place it in the appropriate directory so it shows up in the service menu, but there is where my understanding ends.

Things I don't understand:

1)What goes in main.m. Is it a call to NSApplicationMain(), like in a normal application or do I have to do something different?

2)Where do I instance my object with the service method? Do I do it in applicationDidFinishLaunching:? If so where do I define that. Is it in the object that the service method belongs to? Or do I instead call NSRegisterServicesProvider(), and thus not call NSApplicationMain(). If this is the case, again, where do I instance my object (possibly from main)?

I hope that I am at least partially on the right track. Please excuse my messiness as it is very late. Thanks in advance.

Dave Albert
http://www.appendixa.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.

  • Prev by Date: additional ctrl+click options
  • Next by Date: Re: Transparent Windows are Opaque to Classic
  • Previous by thread: Re: additional ctrl+click options
  • Next by thread: SaveDocumentTo:
  • Index(es):
    • Date
    • Thread