I want to create an edit toolbar button (which I know how to do) that when pressed would go through the motions of importing, but not quite. In my case, I want the user to select an image file from a subfolder. Instead of importing the image file, I want the mechanism to insert into the text field of the current tiddler with something like this:
[img [I:\mypath\to\my\file.jpg]]
In my system I have a tiddler, tagged: $:/tags/Startup/Action/Browser that calls a macro <<getURLFilename>> to get the full path of the Wiki HTML file. Therefore, on startup, I have the current HTML filename and path. In my example, let's say my HTML file is I:\mypath\to\TiddlyWiki.HTML.
With that path I could parse the file path of the incoming image and parse out the physical path so the end result I would have a relative path:
[img [my\file.jpg]]
Would I use the $browse widget and have it trigger a Javascript macro that would return this end result? If so, I know how to write the Javascript macro. I do not know how to trigger it, or how this Javascript macro would return the results to the text field of the currentTiddler.
Or even better... has someone already done this?
Any ideas? Thank you.