On Apr 18, 2011, at 18:45, Jean-Christophe Helary wrote: > I have created a service by using Automator and a "run shell script". > > The problem is that just like all the Automator services I have it tends do > be too slow so I'm considering a rewrite into something more "native". > > I seem to remember there was a well documented section in the developer > documentation about creating services but when I last checked yesterday I > only found that: > > http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/SysServices/introduction.html > > Basically what the service is doing is: > > 1) grep an external text file > 2) pipe the result to remove line breaks (by using "tr") > 3) paste the piped result to the cursor position > > The reason why I created the service in Automator is that I can call it with > a shortcut and Automator does the pasting. I found no way to automate the > pasting with a command line only script (piping the result to pbcopy requires > to do the pasting manually). > > But Automator is sometimes very slow even though the text file is only a few > lines long. > > So I'm looking for a faster solution. > > I've never tried learning to program Objective-C (or anything else for that > matter) and if that's the only solution available I'd appreciate some > pointers. Are there services for which the source is available ?
I see one example (iSpend) in the documentation of protocol NSServicesRequests. There are also numerous code snippets in the documentation link that you included in your message. If you have not done any programming, then that could be a problem (by programming, I mean writing code, not plugging modules in Automator). There are some books for beginners but it's not an easy task. -Laurent. -- Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/ Logiciels Nemesys Software laur...@nemesys-soft.com _______________________________________________ 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