What works:
1.
A "normal" macro
\define d1jpg(filename)
[img[./path/$filename$.jpg]]
\end
called like this
<<d1jpg "$(currentTiddler)$">>
where "$(currentTiddler)$" is replaced by the title of the calling tiddler.
2.
A javascript macro
/*\
title: $:/macros/mine/pathtype.js
type: application/javascript
module-type: macro
<<pathtype $filename$>>
Example:
<<pathtype "20150331_195734.mp4#t=0,17">>
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: true */
"use strict";
exports.name = "pathtype";
exports.params = [
{ name: "filename" }
];
/*
Run the macro
*/
exports.run = function(filename) {
return filename;
};
})();
called with a "normal" string as parameter like this
<<pathtype "20150331_195734.mp4#t=0,17">>
------
What's not working (or not working as expected / wanted):
A js macro like the above called with wikitext variable (currentTiddler) like
<<pathtype "$(currentTiddler)$">>
because the variable is not resolved to it's value, but it's name treated as string.
--> Question: What to change either in the call or in the js-macro so that the currentTiddler variable is resolved to the title of the tiddler within the js function?
Thanks for your patience, I am still struggling with the wiki syntax.
Kind regards.