Peter Folk <pfolk@uni.uiuc.edu> writes: >I was thinking about how nice it would be to have little perl plug-ins to >a number of programs that I use (BBEdit, Eudora, the new Navigator Gold >editor) For BBEdit extensions, writing glue packages is IMHO preferrable. >and I started thinking about what kind of effort this would take. It doesn't >seem that it would be all that much. Nothing is impossible for the man who doesn;t have to do it himself :-) >I see the API as follows: > >void MacPerl(char *script, > char *stdin, // Available as STDIN. The selected text, or > // the whole window if there's no selection... > int *len, // Called with length of stdin buffer > // returns as length of stdout > char **stdout, // Text put on STDOUT > > int (*open)(char *, char *, int) > // Callback to open a new output channel (window or file) > // Arguments: char *windowTitle, /* or fileName */ > // char *windowData, /* or file data */ > // int dataLength /* length of above */ > // Replaces open(), if non-null. Or maybe there should > // be another function MacPerl'ToolOpen()... > ); In fact a library similar to this is used internally in the OSA component. I call it "Palac" for "Perl a la carte". >I'm not sure exactly if this is very good Mac programming (I suspect that >script, stdin, stdout, and windowData should all be Handles or something), In Palac, they are handles. Matthias ----- Matthias Neeracher <neeri@iis.ee.ethz.ch> http://www.iis.ee.ethz.ch/~neeri "One fine day in my odd past..." -- Pixies, _Planet of Sound_