• 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
Refreshing Services menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Refreshing Services menu


  • Subject: Refreshing Services menu
  • From: Michael Scheel <email@hidden>
  • Date: Fri, 8 Mar 2002 14:33:33 -0800

I've been working on a service that takes a text selection and tries
to find a URL in it, and then pass that on to your web browser.
(see http://www.versiontracker.com/moreinfo.fcgi?id=13846&db=mac
or http://www.osxtreme.net/software/OpenService)

In the process of developing this, I constantly kill (-HUP) my service, of
course, and let the Finder/WindowServer/BlackBox restart it automatically
for me. Mostly this works, except for:
#1) the first time to install the service on a new MacOSX box
#2) making any changes to the Info.plist file (including the localized
ServicesMenu.strings)

So, I do some digging around, and I write a Foundation Tool that
does this:
NSLog(@"Refreshing List of Services");
NSUpdateDynamicServices();
NSLog(@"New applications will have refreshed list");
NSLog(@"Quit and restart any applications as needed");

This seems to solve #1 - great for my users, because I can now tell
them to either log out/back in, or go get this other program that
I wrote to call NSUpdateDynamicServices(), and they'll get the new
service.

However, once the Service is up and running, calling this does not seem
to refresh reading in the Info.plist/localized files. If I rename the
directory (say from ~/Library/Services/OpenService.service to
~/Library/Services/NewService.service) and run the Update program, the
new hotkeys/menunames appear correctly, but if I move it back and Update,
it switches to the old behavior. So, it seems to be cached someplace?

My question is whether I am doing something wrong, whether this is a bug
(in NSUpdateDynamicServices() ?) or whether what I am asking is just
impossible.

thanks,
Michael Scheel
OSXtreme.net

--
| Michael Scheel |Network Under Construction Ahead
| UNIX Chaperone |Left Bit Closed
| E Pluribus UNIX |Shift Right
_______________________________________________
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.

  • Follow-Ups:
    • Re: Refreshing Services menu
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Complete Cocoa API Reference posted to Apple Developer Site
  • Next by Date: Re: NSTextView displaying web page
  • Previous by thread: Re: NSTextView displaying web page
  • Next by thread: Re: Refreshing Services menu
  • Index(es):
    • Date
    • Thread