Macro syntax is actually quite simple. Within the body of a macro, only two things happen:
1) replace instances of $param$ with the corresponding value passed as a macro parameter
2) replace instances of $(variable)$ with the corresponding value from a variable defined outside the macro
Other than these two actions, the content of a macro is simply "returned" and is inserted in place of the macro call itself. The substituted content is then processed by the TWCore as if it had been directly entered where the macro occurred.
For example, if you define a macro like this:
and then invoke that macro like this:
<<makeimg "foo">>
the resulting content will be
Note that the parameter passed to the "makeimg" macro is literal text, so it's just enclosed in simple quotes. However, for your desired use-case, you want the parameter value to be retrieved from a tiddler field. You might think to try writing: <<makeimg {{!!isbn}}>>. Unfortunately, this won't work, because the <<macroname ...>> syntax doesn't directly handle the use of {{!!fieldname}} for specifying the parameter value. Fortunately, there is another way to invoke a macro, by using the <$macrocall .../> *widget* syntax, which DOES allow use of {{!!fieldname}} references to specify parameter values. Thus, to achieve your goal, you can write:
<$macrocall $name="makeimg" isbn={{!!isbn}} />
When the above $macrocall is processed, the value stored in the tiddler field is retrieved and passed into the macro for substitution processing. The resulting syntax is then "returned" and inserted in place of the <$macrocall .../> syntax, which is then processed by the TWCore to render the image.
Alternatively, instead of passing the field value as a parameter, you could retrieve the value as a *variable* before invoking the macro, and then reference that variable within the body of the macro definition, like this:
which would be invoked like this:
<$vars isbn={{!!isbn}}> <<makeimg>> </$vars>
Using either method, the result is the same: the value from the tiddler field is used to construct the desired URL for the [img[...]] syntax.
enjoy,
-e