Hi everyone !
I am trying to create a macro that help me insert image inside my tiddlers.
What I lack, is a way to choose a default directory with the <$browse> widget (currently, it seems it open the last directory I used to import, or something like that).
My current code is :
\define rename-import(new-name)
<$action-sendmessage $message="tm-perform-import" $param="$:/Import"/>
<$action-sendmessage $message="tm-rename-tiddler" from={{{[[$:/Import]links[]first[]]}}} to=$new-name$/>
<$action-setfield $tiddler=$new-name$ tags=[[Image]]/>
\end
\define image-block(image-name)
<$navigator>
<$browse />
</$navigator>
<$list filter="[[$:/Import]plugin-type[import]]">
<$button actions=<<rename-import $image-name$>>>
import
</$button>
</$list>
Image name : [[$image-name$]]
{{$image-name$}}
\end
<<image-block "plop">>
Btw, I don’t really undertand how the <$navigator> widget works, but it seems to do what I wanted. (I found it on this site).
Thanks !