[TW5] External Link with embedded macro call

80 views
Skip to first unread message

Bob Flandard

unread,
Sep 12, 2015, 6:10:13 PM9/12/15
to TiddlyWiki
Hello,

I'm using an external link, like:

[ext[Link text|file:///C:\Users\Bob\Videos\file.mp4]]

which works.

But if I replace:
 "file:///C:\Users\Bob\Videos\file.mp4"
with a macro call

[ext[Link text|<<myMacro arg1 arg2>>]]

The result of the macro is not being substituted into the link string as I expected (as seen by hovering the mouse over the created link).

How should this be done?

Thanks, Bob

Eric Shulman

unread,
Sep 12, 2015, 6:27:24 PM9/12/15
to TiddlyWiki
On Saturday, September 12, 2015 at 3:10:13 PM UTC-7, Bob Flandard wrote:
[ext[Link text|file:///C:\Users\Bob\Videos\file.mp4]]
which works.
[ext[Link text|<<myMacro arg1 arg2>>]]
The result of the macro is not being substituted into the link string as I expected (as seen by hovering the mouse over the created link).
How should this be done?

Use the macro to assemble and output the entire link syntax, like this:

\define myMacro(text,arg1,arg2)
[ext[$text$|... stuff using $arg1$ and $arg2$ ...]]
\end
<<myMacro "link text" "arg1" "arg2">>

enjoy,
-e
Eric Shulman
ELS Design Studios
TiddlyTools - "Small Tools for Big Ideas!"
InsideTiddlyWiki: The Missing Manuals

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:

Bob Flandard

unread,
Sep 13, 2015, 4:00:07 AM9/13/15
to TiddlyWiki
Thanks Eric,

I guess I should have tried that, but it was past my bedtime and half of my brain cells were asleep and the other one was sipping a soothing malt based drink.

All the best, Bob
Reply all
Reply to author
Forward
0 new messages