HI NT, try this:

 <$macrocall $name="pathtype" filename="<<currentTiddler>>"/>

all the best
BJ

On Friday, December 4, 2015 at 10:48:49 PM UTC, NT wrote:
>
> 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.
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/943332ec-e84a-499a-898b-fd485d4f6418%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to