Re: Developing a Stand-Alone Service in Snow Leopard

2009-09-14 Thread Steve Cronin

Folks

To clarify my initial problem statement:
If I recompile and then issue a "pbs" and then invoke the service it  
continues to execute an earlier instance of the service -- NOT the  
freshly compiled instance….

This is easy to prove

A set of followup questions on STAND-ALONE services

1) How do I programmatically 'check' the service in System Preferences/ 
Keyboard/Services?
I offer the user the option of installing a service.  If they elect to  
install it seems reasonable that they would want the service engaged.

Is the only option to open the System Preferences at the pane?
I offer the new shiny; the user says yeah let's use the new groovy  
stuff;
An then I have to say "sorry I can't figure that out for you -- here's  
a window  here's a whole bunch of scary looking text - give it your  
best shot…

(seems pretty lame to me)

2) Since I offer the option to install, I offer the option to uninstall.
Is it safe to do this?  The .service bundle is marked as open by the  
system.
Is it sufficient to do:   if ([[NSFileManager defaultManager]  
removeFileAtPath:myServicePath handler:self]) NSUpdateDynamicServices();


Thanks for your time and consideration!
Steve


On Sep 14, 2009, at 1:16 AM, Steve Cronin wrote:


John;

That's good information but I don't see how it helps with a stand- 
alone service  -  how do I (or user) launch the .service bundle?


Steve

On Sep 14, 2009, at 1:12 AM, John C. Randolph wrote:



On Sep 13, 2009, at 10:55 PM, Steve Cronin wrote:

I have convinced myself that the only way to get Snow Leopard to  
recognize the newer version of the service is to log out and back  
in.

This is tedious.  Is there something I'm missing?


As I recall, each app builds its services menu when it launches.   
Any app launched after you run pbs should show a correctly updated  
services menu.


-jcr





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Developing a Stand-Alone Service in Snow Leopard

2009-09-13 Thread Steve Cronin

John;

That's good information but I don't see how it helps with a stand- 
alone service  -  how do I (or user) launch the .service bundle?


Steve

On Sep 14, 2009, at 1:12 AM, John C. Randolph wrote:



On Sep 13, 2009, at 10:55 PM, Steve Cronin wrote:

I have convinced myself that the only way to get Snow Leopard to  
recognize the newer version of the service is to log out and back in.

This is tedious.  Is there something I'm missing?


As I recall, each app builds its services menu when it launches.   
Any app launched after you run pbs should show a correctly updated  
services menu.


-jcr



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Developing a Stand-Alone Service in Snow Leopard

2009-09-13 Thread John C. Randolph


On Sep 13, 2009, at 10:55 PM, Steve Cronin wrote:

I have convinced myself that the only way to get Snow Leopard to  
recognize the newer version of the service is to log out and back in.

This is tedious.  Is there something I'm missing?


As I recall, each app builds its services menu when it launches.  Any  
app launched after you run pbs should show a correctly updated  
services menu.


-jcr

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Developing a Stand-Alone Service in Snow Leopard

2009-09-13 Thread Steve Cronin

Foks;

I'm trying to develop a stand alone service in Snow Leopard.
The issue I'm running into is how to update the system as I compile a  
new version.
The pbs command shows that the bundle path is the one in my Release  
Build folder


 "pbs -dump_pboard"
{
NSBundleIdentifier = "com.myCompany.myService";
NSBundlePath = "/Volumes/myMacBookPro/Projects/XYZ/Code/ 
build/Release/MyService.service";

NSKeyEquivalent = {
};
NSMenuItem = {
default = MyService;
};
NSMessage = myService;
NSPortName = myServicePort;
NSSendTypes = (
NSStringPboardType,
NSRTFPboardType,
NSTabularTextPboardType
);

So when I recompile I do the following:
1) 'Uncheck' the item in the SysPref/Keyboard/Services list
2) Compile a new version
3) run  "/System/Library/CoreServices/pbs"
4) 'Check' the item in the SysPref/Keyboard/Services list
5) Test the service by using the context menu (which is appearing at  
the right time)


I have convinced myself that the only way to get Snow Leopard to  
recognize the newer version of the service is to log out and back in.

This is tedious.  Is there something I'm missing?

Steve
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com