On Friday, October 11, 2002, at 09:43 AM, Alexandre Enkerli wrote: > Did anyone try building a System Service (in the "Services" submenu) > to apply Perl regular expressions on selected text? > What I have in mind is a Perl version of WordService: > <http://home.arcor-online.de/grunenberg/wordservice.html> > So we could have a bunch of preset scripts triggered by keystrokes as > well as a way to enter one-liners or custom scripts directly from any > Services-aware app. > I'm not sure about this but it could possibly preserve text styles in > RTF files...
This may not be the answer that you are looking for, but you can do almost all of this in BBEdit (but it doesn't work with RTF or styles). Perl Filters and Perl scripts will give you the functionality you desire. Custom scripts are there. There isn't a very convenient way to do one-liners though. (I have a dummy filter that I put one-liners in.) These aren't exported as services though, so you'll only have the transforms from within BBEdit. As far as building a service that does this, the one bump I think you'll run into is that I don't believe that it is currently possible to have a dynamic list of exported services. So to add a new script to your services, you'll have to update the plist and rebuild the service. Jim
