MacPerl Word Services © Michael SchŸrig 1998 Ever wanted to run a Perl script on text in some application? Well, with this MacPerl Extension there's some chance that you can do it Ñ if the application in question supports the Word Services Protocol. Please note: This is beta software and not yet well-tested! Make sure you have a current backup before playing with it. Installation There are two versions of the extension: a "normal" one that keeps quiet and a debug version that logs all that it does in a window. Put one of them into the "MacPerl Extensions" folder inside the MacPerl folder. How do I use it? Write a script that reads input from stdin and writes to stdout. Save it as a "Word Services Server" and register it with an application that supports this protocol, e.g. Eudora Pro or Tex-Edit+. From within the application choose the appropriate command to run the script. Okay, I admit, this is rather clumsy and there aren't that many applications that support Word Services Ñ but something better is coming. Sorry to be nebulous. What about diagnostic output/stderr? Currently everything that's written to STDERR is simply ignored. If you want to see it in MacPerl's output window put open(STDERR, ">>Dev:Console"); at the beginning of your script. What's that "Switch Logging" droplet? Exactly what the name says. If you're tired of all the debugging output generated by a script saved with PerlWS-debug use the droplet to switch it off (and on again, if you like). The droplet requires several Scripting Additions: - "info for" from the standard AppleScript distribution - "Extract Resource" and "Add Resource" from the GTQLibrary (look for it on info-mac). Where to find out about Word Services in general? Have a look at . There's also a list of applications that support the Word Services Protocol. Know Shortcomings & Unresolved Issues - MacPerl doesn't like it if it's told to quit while being in the background. It'll blink at you until it's switched to the front. - WSS scripts don't automatically quit after their work is done. - What to do if a script saved as a WSS script is opened in the Finder? Edit it in MacPerl? - Why isn't this ReadMe written in POD format? Version History 1.0b3 Corrected a bundle blunder. 1.0b2 Slightly improved error handling. 1.0b1 First public beta. Disclaimer You might have guessed it already, but I take no responsibility for the consequences of anything these MacPerl Extensions or scripts using them do to your computer. If you think this is unacceptable, just don't use it. That's it for now. I appreciate any bug reports and suggestions. Have as much fun with this thingie as possible. Michael SchŸrig