I am merely an opinionated spectator (although when I have some time I'd
like to get involved in development), but I have been following the macros
topic with interest.
>> > You could use XML for saving macros. Of course you could also use
>> > scheme BUT: There are libraries e.g. libxml which allow very simple
>> > loading and saving of XML files while we would possibly have to write
>> > one for any other language first.
>> Well, we _do_ have gimp-perl available... With XML, we'd have to write
>I first didn't understand you... but it now occured to me. The most
>natural save format for macros is either python, perl or scheme or any
>other language ;)
>> you like best), we'll `just' have to add some saving hooks into the PDB
>tracing hooks, think "strace" for gimp. That way the logulator (for
>example) could be implemented much cleaner.
One of the things I like about Gimp is that you can script it with Any Damn
Language You Please* (* as long as someone writes a plug-in for it). It
seems to me that macro recording is basically the reverse side of the coin.
Shouldn't there be a generic interface to allow "recorders" to receive
notification of actions, and record them as required? (Like the tracing
hooks mentioned above.) That way, if you want to record macros in XML, you
can have an XML recorder plug-in, and an XML-Fu plug-in to replay them. If
you are a Perl hacker, you use the Perl recorder that pumps out a Perl
script in a form that can then be used exactly like a hand-written script.
Some other programs (dare I mention certain Office suite programs) allow
scripting and macro recording in a single language. The Gimp has extended
this in the scripting side. It would then seem odd to me to allow the user
to record a macro only in a form that is inconsistent with the user's other
The great thing about macro recording for scripters is that it removes the
need for a lot of knowledge and research. You just record a few actions,
and then go in and edit the recorded file to add control structures, extra
Conceptually, the writing of high-level language code for macro recording
is not difficult, since macros are a simple sequence of actions. (Actually
implementing it obviously requires a lot of knowledge of the application,
though.) No matter what the output format is, it would just be a matter of
a (recorder) handler function writing strings containing arguments passed
in, for each recorded step (and perhaps putting out a canned header and
footer). It shouldn't be any harder in Perl or Scheme than in XML.
Presumably any scripting plug-in and its recording plug-in should be
maintained as an item.
I would be disappointed to see the recording mechanism restricted to a
single output format (especially if it were one without the power of a full
programming language). It would, of course, be possible to write, say,
XML-macro-to-Perl or scheme-macro-to-Perl converters, but running these
would be double-handling every time the user recorded a macro. And if the
conversion work is going to be done anyway, it would be nicer to make the
interface generic, for symmetry, efficiency, and end-user ease-of-use.
Comments or flames?