Tuesday, February 12, 2008

More on Services

In previous article, we introduce Services. This time, we will show some more applications which supports services.


Affiche is a sticky-note application.


You can create notes in different colours, change fonts on text and set titles. Notes with titles will show up in menu Windows. These settings can be applied globally in preferences or individually. Text can be imported and exported.


Once Affiche is installed, you can use service to create new note from any application with text view. In this case, select text in Ink, choose menu 'Services > Affiche > Make Note'. If Affiche is not running, it will launch automatically and make a new note based on selected text. It shows how convenient services are.

DictionaryReader is another good example. If you downloaded Étoilé project before, it is under Etoile/Services/User/DictionaryReader/.


It looks up definition with DICT protocol. Although it supports local dictionaries, I had hard time to find a good one. So it may be wise to use the remote servers, which is the default setting. It also provides a service to look up definition of selected text in any application with text view.

For advanced users, I wrote a small application to use Unix scripts as services. It is inspired by Terminal. Unfortunately, Terminal is not maintained for a long time and does not compile with latest GNUstep. For developers, it is quite easy to fix. You can get ScriptServices by

svn co http://svn.gna.org/svn/etoile/branches/yjchen/ScriptServices ScriptServices

After installation, you need to run `openapp ScriptServices --update` to update services. You have to do that every time you install new scripts as services. Once services are updated, you should be able to see a Calculate service in Services menu. It calculates your selection with Unix bc and return the result. There are some useful scripts in Examples subdirectory. You just need to copy them to ~/GNUstep/Library/ApplicationSupport/ScriptService/ and run `openapp ScriptServices --update`. For more dtails, see README of ScriptServices.

ScriptServices is far from perfect. But it makes a point that you can reuse many Unix tools from GNUstep through services. It opens doors for countless applications.

Previous articles in this series:

  • Gomoku and Localization in GNUstep
  • Font Manager and GNUstep Backend
  • System Preferences and Theme
  • Ink, a GNUstep text editor, and Services
  • Addresses, a contact manager
  • StepChat, TalkSoup, and Grouch

  • No comments: