PDA

View Full Version : Need idea about a project implementation




satyam90
Apr 25, 2009, 11:39 AM
I want my application running in background when I start it. When user high lights and selects some text ( anywhere like email, web page, document etc) and presses custom hot keys on keyboard (apple command button + F1), my application pops up a dialog with the selected text and {OK, Cancel} buttons. it proceeds further when OK is clicked and so on......................

I am not getting any idea how to implement it. Can some body suggest me how to Make my application run in background without any window in main and get the selected text.

I will be greatfull to all who can help me.



kainjow
Apr 25, 2009, 12:25 PM
This sounds like it could be done as a system service (http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/SysServices/SysServices.html).

satyam90
Apr 25, 2009, 01:26 PM
Excellent kainjow.

I have gone through the content about Providing Services (http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/SysServices/Tasks/providing.html#//apple_ref/doc/uid/20000853).
But need some clarifications.
1. If I am wring my code using XCode using Obj C/Java, which project I have to select initially. Will I have to select Cocoa Application or Core Foundation or Core service based application.
2. I am not able to see Library/Services folder on my Mac Tiger. Where can I find it on Mac Tiger or Mac Leapord.

If some body has atleast the skeleton for the project, it will be easy to understand. Can anyone share service based application prototype code with me?

satyam90
Apr 26, 2009, 01:19 AM
View the link Cocoa Service application (http://homepage.mac.com/simx/technonova/tips/creating_a_service_for_mac_os_x.html)

kpua
Apr 26, 2009, 02:28 AM
You may have to create /Library/Services or ~/Library/Services yourself. The system may not have created them for you if there aren't already custom services installed on your machine.

Take a look at /Developer/Examples/AppKit/SimpleService for an example service to work from.