Wikifying your FF bookmarks, kind of.

41 views
Skip to first unread message

Amzg

unread,
Nov 21, 2009, 6:11:18 PM11/21/09
to TiddlyWiki
Just discovered that if you use FF (untried for other browsers), then
you can right click on a bookmarks folder, choose copy, and then paste
into a tiddler, resulting in a list with all the bookmark-addresses

This is obviously powerful in combo with FramedLinksPlugin * letting
you click on any of those listed bookmark-links and get an iFrame
opening right in the list.

* http://www.TiddlyTools.com/#FramedLinksPlugin

Måns

unread,
Nov 22, 2009, 3:47:45 PM11/22/09
to TiddlyWiki
Great - Thanks for sharing
(it doesn't seem to work in Google Chrome though... but never mind -
it's a great tip)

Another slightly related question:
I wonder how you "embed" bookmarkletscripts in a tiddler ?
Can you just copy/paste it and add some code to make it work in a
tiddler?

Regards Måns Mårtensson

BC

unread,
Nov 22, 2009, 3:11:37 PM11/22/09
to TiddlyWiki
Google ate my post earlier; trying again.
Thanks for the fantastic tip! It never occured to me to copy bookmarks
by folder. More incentive for me now to use folders in the first
place; I tend to get lazy. In fact, I hate bookmarking so much that I
usually just use the Copy All Urls addon and paste URLs into text
files. (https://addons.mozilla.org/en-US/firefox/addon/934)

And I didn't know about the FramedLinksPlugin -- brilliant! (I just
wish I could do the same thing with the MiniBrowser plugin, so I could
resize the frames at will, depending on content)

Thanks! I was happily making use of your tip within minutes of reading
your post.

BC

BC

unread,
Nov 22, 2009, 10:00:07 AM11/22/09
to TiddlyWiki
On Nov 21, 6:11 pm, Amzg <matiasg...@gmail.com> wrote:
Splendid tip! It never occurred to me to try to copy links by folder.
And I didn't know about the FramedLinksPlugin; amazing. I was making
good use of it within a few minutes of reading your post.
(I just wish I could do the same thing with the MiniBrowser plugin)

Incidentally, if like me, you tend to have too many tabs open all at
once and don't want to bookmark them, the Copy All Urls Firefox add-on
works great for tiddly bookmarking also:
https://addons.mozilla.org/en-US/firefox/addon/934

Thanks! Now I have more incentive to stop bookmarking at random, and
pay more attention to folders; very handy.

- BC

Måns

unread,
Nov 23, 2009, 1:48:24 AM11/23/09
to TiddlyWiki
Hi BC
> (I just wish I could do the same thing with the MiniBrowser plugin)
You can.
If you paste the list into a hr-separated list and open it with a
miniBrowser.
MiniBrowser defaults to open with miniBrowserList. If you paste the
bookmarks into this list (and add a description to each entry) you'll
be able to open them directly from miniBrowser.
----
descr
http://xxx.org
----
descr
https://yyy.net
----

You can specify a list to use with miniBrowser like this:
<<miniBrowser MiniBrowserFavoritsList>>

> Incidentally, if like me, you tend to have too many tabs open all at
> once and don't want to bookmark them, the Copy All Urls Firefox add-on
> works great for tiddly bookmarking also:https://addons.mozilla.org/en-US/firefox/addon/934

Thanks for sharing..

Regards Måns Mårtensson

BC

unread,
Nov 23, 2009, 4:35:37 AM11/23/09
to TiddlyWiki


On Nov 23, 1:48 am, Måns <humam...@gmail.com> wrote:
> Hi BC> (I just wish I could do the same thing with the MiniBrowser plugin)
>
> You can.
> If you paste the list into a hr-separated list and open it with a
> miniBrowser.
> MiniBrowser defaults to open with miniBrowserList. If you paste the
> bookmarks into this list (and add a description to each entry) you'll
> be able to open them directly from miniBrowser.
> ----

I was referring to use of the FramedLinksPlugin that the OP mentioned.
I already use the Minibrowser plugin. The point is I would like an
option in the FramedLinksPlugin to open the links within a mini
browser instead of a plain iframe. Rather than maintaining hr-
seperated lists, I'd just as soon work from the non-hr seperated lists
I already have. When I first started using the MiniBrowser plugin, I
thought how nice it would be if I could just have mini browsers open
spontaneously in response to clicking on a URL in any tiddler, without
having to insert the command in the tiddler first. Then I saw the OP's
reference to FramedLinksPlugin -- which does exactly what I want, but
with iframes instead of minibrowsers. (unless I missed something in
the options?)

-BC

Måns

unread,
Nov 23, 2009, 5:37:42 AM11/23/09
to TiddlyWiki
> The point is I would like an
> option in the FramedLinksPlugin to open the links within a mini
> browser instead of a plain iframe. Rather than maintaining hr-
> seperated lists, I'd just as soon work from the non-hr seperated lists
> I already have. When I first started using the MiniBrowser plugin, I
> thought how nice it would be if I could just have mini browsers open
> spontaneously in response to clicking on a URL in any tiddler, without
> having to insert the command in the tiddler first. Then I saw the OP's
> reference to FramedLinksPlugin -- which does exactly what I want, but
> with iframes instead of minibrowsers.

Hi BC

My first attempt in making a script/macro button to provide a similar
effect with a nested miniBrowser for each link in a normal
(lineseparated list) -

Copy the script into a tiddler with a title xxx. (don't click the
scriptbutton - it will overwrite the tiddler)

In your list with links - write <<tiddler xxx>> - click done and click
the new button L2mB:

You'll get a button (link) for each link (if you have
NestedSlidersPluign installed) When clicked upon you'll get a
miniBrowserwindow with the actual url opened...

I'm still working on getting the url text into the label of the
button..

<script label="L2mB" title="convert list to miniBrowserlinks in
slides. (needs miniBrowserPlugin and NestedSlidersPlugin)">
var here=story.findContainingTiddler(place);
if (!here) return;
var title=here.getAttribute("tiddler");
var tid=store.getTiddler(title);
var t=store.getTiddlerText(tiddler.title) ;
var target = store.getTiddler(tiddler.title) ;
var txt='+++[Link]... <<miniBrowser '+tid.text.split('\n').join('>>===
\n+++[Link]... <<miniBrowser ')+'>>===';
store.saveTiddler
(tid.title,tid.title,txt,tid.modifier,tid.modified,tid.tags,tid.fields);
</script>

Regards Måns Mårtensson

Måns

unread,
Nov 23, 2009, 6:16:15 AM11/23/09
to TiddlyWiki
Best use of this script would be to put it in the viewtemplate* as a
toolbarbutton and only show it when lists are tagged with sometag..
(In the description above the last linkbutton has <<tiddler
miniBSlidesScript) as the last/or first link button - depending on
where you put the button in the tiddler..

*<span macro="showWhenTaggedAny LinksList"><span class='toolbar'
macro='tiddler miniBSlidesScript'></span></span>

Needs HideWhenPlugin (http://mptw.tiddlyspot.com/#HideWhenPlugin)


Regards Måns Mårtensson

Amzg

unread,
Nov 23, 2009, 9:31:50 AM11/23/09
to TiddlyWiki
On Nov 22, 4:00 pm, BC <bruce.armstr...@gmail.com> wrote:
> Incidentally, if like me, you tend to have too many tabs open all at
> once and don't want to bookmark them, the Copy All Urls Firefox add-on
> works great for tiddly bookmarking also:https://addons.mozilla.org/en-US/firefox/addon/934

HA! That is GREAT!! Bookmark-LISTS are much more suitable in TW than
FF because it is a lot easier to edit such a list in TW and, via
framedLinksPlugin, take a peek at a bookmark.

...and how about this little addition;

Create a tiddler titled URLlist, and put the following [1] in it:
<<newJournal title:'URLs - YY0MM0DD' tag:'URLs' label:'Ctrl+Alt+C then
paste' >>

Pressing the resulting button gives a new tiddler where to paste the
URL list, and it is automatically named with todays date and tagged
with URLlist.

You can then use a <<tiddler [[URLlist]]>> macro to put the resulting
button e.g in the sidebar, perhaps accompanied by a slider to show the
URLlist (via e.g TagglyTagging [2] or a forEachTiddler).

Now, the resulting list from that firefox addon is pretty messy. It
would be great if it somehow could be turned into pretty wikilinks,
i.e from the current format;

URL1
Name1
URL2
Name2

into

[[Name1|URL1]]
[[Name2|URL2]]


Any thoughts?

:-)


[1] from here:
http://groups.google.com/group/tiddlywiki/browse_thread/thread/1a637249fb564f77/59a74f08f36dfffa?lnk=gst&q=blog#59a74f08f36dfffa
[2] http://mptw.tiddlyspot.com/#TagglyTagging

Mark S.

unread,
Nov 23, 2009, 12:07:42 PM11/23/09
to TiddlyWiki
If you have Eric's Inline Javascript plugin, then this code will do a
quick and dirty job:

<script>
var txt = store.getTiddlerText("URL_LIST") ;
var ara = txt.split("\n") ;
var out = "" ;
for(var i=0;i<ara.length;i+=2)
out += "[[" + ara[i+1]+"|"+ara[i]+"]]\n" ;
return out ;
</script>

Where "URL_LIST" is the name of your tiddler with the alternating urls
and descriptions. Obviously this could be parameterized to use the
<<tiddler>> inclusion macro.

I haven't tried the FF plugin, but it sort looks like you should be
able to make it produce a wikified output.

Mark
> [1] from here:http://groups.google.com/group/tiddlywiki/browse_thread/thread/1a6372...
> [2]http://mptw.tiddlyspot.com/#TagglyTagging

Måns

unread,
Nov 23, 2009, 2:44:55 PM11/23/09
to TiddlyWiki
Hi Mark

Great script you've made - it solved many problems I encountered -
trying to make my own.
Thanks..
How do I make your script use a hr-separated list but skip the
'----' ?

I've put my question to you in a MTC showing what options I have been
playing with...

There are two variations made to your UrlList-script and 2 scripts
with very different purposes (one overwrites a tiddlerList and the
other filters a list and wikifies the result), which I've produced
from different snippets, some of them I had from you and some from
Eric.

http://tinyurl.com/ToMark

Regards Måns Mårtensson

Mark S.

unread,
Nov 23, 2009, 3:21:50 PM11/23/09
to TiddlyWiki
This is an extremely literal solution (not necessarily the best):

<script>
var txt = store.getTiddlerText("URL_LIST") ;
var ara = txt.split("\n") ;
var out = "" ;
for(var i=0;i<ara.length;i+=3)
out += "[[" + ara[i]+"|"+ara[i+1]+"]]\n" ;
return out ;
</script>

This works as long as every 3rd line is a HR. Note also that the HR
separated list format reverses the order of the URL and the Title from
that generated by the FF plugin.

Mark

Måns

unread,
Nov 23, 2009, 3:51:05 PM11/23/09
to TiddlyWiki
Thanks a lot Mark -

I've tested it here: http://tinyurl.com/yafgwpp
Works very well...

One last question from me:

I would like to make a version of your script which will overwrite the
URL_LIST with the result..
Will it work if I replace
"return out;</script>" with "store.saveTiddler
(tid.title,tid.title,txt,tid.modifier,tid.modified,tid.tags,tid.fields);
</script> " ?

Måns

Mark S.

unread,
Nov 23, 2009, 4:40:08 PM11/23/09
to TiddlyWiki
Hi Måns,

The following code should work -- use with discretion.

Because you want to write over the same tiddler that you are using as
source, I added a bit of code to check if the tiddler has been
formatted. This should prevent you from running the script twice and
mangling the list. Got backups?

You can see that the very first variable holds the name of the source
listing to be formatted. A few other changes were necessary as well.

Mark

<script>
var src = "URL_LIST" ;
var txt = store.getTiddlerText(src) ;
if(txt.indexOf("[[") != -1) return "Tiddler " + src + " is already
wikified." ;
var tid = store.getTiddler(src) ;
var ara = txt.split("\n") ;
var out = "" ;

for(var i=0;i<ara.length;i+=3)
out += "[[" + ara[i]+"|"+ara[i+1]+"]]\n" ;
store.saveTiddler
(src,src,out,tid.modifier,tid.modified,tid.tags,tid.fields);
return "Tiddler " + src + " now wikified." ;
</script>

Måns

unread,
Nov 23, 2009, 5:01:17 PM11/23/09
to TiddlyWiki
Hi Mark this is GREAT.. (but dangerous I know - therefore I have 1
extra question)

I know I said it was my very last question.... - but I have one last
request, which will make the script even more usable eg as a button in
the sidebar..

How do I get the script to prompt for a tiddlertitle and run the
script on the chosen tiddler?
This is a snippet I found somewhere - but I don't know how to
implement it in your script:

var tid=prompt("Write title of tiddler with list to convert"); if (!
tid || !tid.length) return;
story.displayTiddler(story.findContainingTiddler(place),tid);
return false;

Regards Måns Mårtensson

Amzg

unread,
Nov 23, 2009, 6:07:33 PM11/23/09
to TiddlyWiki
Hey, that is fantastic! Thank you and thank to Mr. Shulman!

Then how about this modification;

<script>
var txt = store.getTiddlerText("URLs091123") ;
var ara = txt.split("\n") ;
var out = "" ;
for(var i=0;i<ara.length;i+=2)
out += "<<newJournal title:'" + ara[i+1]+ "' tag:'URLs' label:'T' >>
[[" + ara[i+1]+"|"+ara[i]+"]]\n" ;
return out ;
</script>

The idea is to put a little tiddlifier-button (T) in front of each
link that, if pressed, creates a separate tiddler with the name of the
url. This way separate links/bookmarks can be tagged easily for easy
association with what-be-it in your TW. Unfortunately the above is my
best shot (and I'm astonished to say it works!)... but how would I
include the URL as *content* in the created tiddler?

If you allow me to get a bit philosophical; I think a seamless
integration between TW and the web - or rather; between tiddlers and
webpages - is desirable. Tiddlers are "snippets of information" that
you're interested in - and so are webpages, so it makes sense to me to
keept it all in the smooth TW interface.

:-)

Amzg

unread,
Nov 23, 2009, 6:13:16 PM11/23/09
to TiddlyWiki
On Nov 23, 9:51 pm, Måns <humam...@gmail.com> wrote:
>
> I would like to make a version of your script which will overwrite the
> URL_LIST with the result..

If this is unsafe, mabye it'd be better to create the result in a new
tiddler and somehow delete the URL_LIST automatically (I have no idea
how)?

Mark S.

unread,
Nov 23, 2009, 6:31:18 PM11/23/09
to TiddlyWiki
This should do something like what you want. The script turns into a
link that you click to activate.

Good luck,
Mark

<script label="Wikify a HR Tiddler">
var src=prompt("Write title of tiddler with list to convert");
if (!src || !src.length) {
alert("Could not find tiddler by name of " + src + "." ) ;
return false;
}
var txt = store.getTiddlerText(src) ;
if(txt.indexOf("[[") != -1) {
alert ( "Tiddler " + src + " is already wikified." ) ;
return false ;
}
//var tid = store.getTiddler(src) ;
var ara = txt.split("\n") ;
var out = "" ;

for(var i=0;i<ara.length;i+=3)
out += "[[" + ara[i]+"|"+ara[i+1]+"]]\n" ;
store.saveTiddler
(src,src,out,tid.modifier,tid.modified,tid.tags,tid.fields);
//return "Tiddler " + src + " now wikified." ;
story.displayTiddler(story.findContainingTiddler(place),src);
//return false;
</script>

Måns

unread,
Nov 23, 2009, 7:28:20 PM11/23/09
to TiddlyWiki
Thanks a million Mark!!
Cheers
Måns Mårtenssonb

Måns

unread,
Nov 23, 2009, 7:42:51 PM11/23/09
to TiddlyWiki
Hi again again

> This should do something like what you want. The script turns into a
> link that you click to activate.
>
> Good luck,

When I write MiniBrowserList in the prompt I get: ReferenceError: tid
is not defined..

Please test (the button is in the sidebarmenu)
http://dl.dropbox.com/u/1064531/screendmp/FunWTW/empty/empty.html

Regards Måns Mårtensson

Mark S.

unread,
Nov 23, 2009, 9:11:07 PM11/23/09
to TiddlyWiki
Hi Måns,
Very mysterious. Believe this line:

//var tid = store.getTiddler(src) ;

Should be this line:
var tid = store.getTiddler(src) ;

Not sure how that happened, since it seemed to test fine.

Oh well -- hope this fixes it. Looking at your browser list, though,
it appears you may have some broken url's.

Good luck,
Mark

Amzg

unread,
Nov 24, 2009, 5:57:21 AM11/24/09
to TiddlyWiki
Mark, thank you so much!

Here is a slightly modified version including my last thoughts from
above, i.e with a little bookmark-button before to each link. Quite
possibly hacky due to my cut-paste-trial-error-approach to
programming. Oh, btw, it is remodified for not a HR list but the
original link-title list format

BTW, maybe there's a way to paste the "clipboarded link list" DIRECTLY
into the script prompt (or equivalent)? I mean instead of having to
pasting it into a separate tiddler and then having to type the tiddler
name into the script.


<script label="Wikify URL-list">
var src=prompt("Write title of tiddler with list to convert");
if (!src || !src.length) {
alert("Could not find tiddler by name of " + src + "." ) ;
return false;
}

var txt = store.getTiddlerText(src) ;
if(txt.indexOf("[[") != -1) {
alert ( "Tiddler " + src + " is already wikified." ) ;
return false ;
}

var tid = store.getTiddler(src) ;
var ara = txt.split("\n") ;
var out = "" ;

for(var i=0;i<ara.length;i+=2)
out += "<<newJournal title:'" + ara[i+1]+ "' tag:'Bookmark' text:'[["
+ ara[i+1]+"|"+ara[i]+"]]' label:'ᵒ' >>[[" + ara[i+1]+"|"+ara[i]+"]]
\n" ;
store.saveTiddler
(src,src,out,tid.modifier,tid.modified,tid.tags,tid.fields);
//return "Tiddler " + src + " now wikified." ;
story.displayTiddler(story.findContainingTiddler(place),src);
//return false;
</script>





Amzg

unread,
Nov 24, 2009, 5:59:28 AM11/24/09
to TiddlyWiki
For the record: It should be noted that any link containing e.g a pipe
sign (i.e | ) messes up things. As would e.g links with ]] etc.

Amzg

unread,
Nov 24, 2009, 10:05:53 AM11/24/09
to TiddlyWiki
Some furtherifications;

If not possible to somehow do the pasting directly into the prompt or
equivalent (as suggested above) then, second best, maybe it's possible
to make Marks script automatically use the latest created tiddler,
i.e omitting the need to type in anything manually in the prompt?
Instead of the [[ check one could check for "http://" to *be* there.

Amzg

unread,
Nov 25, 2009, 8:42:53 PM11/25/09
to TiddlyWiki
After a lot of digging[1], I found this snippet;

story.findContainingTiddler(this).getAttribute('tiddler')

and figured I'd just replace Marks input prompt, i.e like this;

var src=story.findContainingTiddler(this).getAttribute('tiddler');

The idea is to paste an URL-list into a tiddler, and save, and then
press marks "macro button" that is in the sidebar(!)

Unfortunately it doesn't work. It doesn't get what "this" is.
Is there a default word other than "this", such as "latest"... or do I
just mistunderstand it all?

thanks!

:-|

[1] ...in a Mr.Shulman post, of course;
http://groups.google.com/group/tiddlywiki/browse_thread/thread/bbfcc35e63096a8c/cc8f51e5073de447?lnk=gst&q=scroll+to+top+of#cc8f51e5073de447

Måns

unread,
Nov 26, 2009, 1:25:43 AM11/26/09
to TiddlyWiki
Hi Amzg

> The idea is to paste an URL-list into a tiddler, and save, and then
> press marks "macro button" that is in the sidebar(!)
Try to it in the viewtemplate instead.
<span class='toolbar' macro='tiddler MarksMacroButton'></span>
or
<span macro="showWhenTaggedAny List"><span class='toolbar'
macro='tiddler MarksMacroButton'></span></span>
requires HideWhenPlugin http://mptw.tiddlyspot.com/#HideWhenPlugin

Regards Måns Mårtensson

Amzg

unread,
Nov 27, 2009, 8:34:53 AM11/27/09
to TiddlyWiki
Thank you Måns! What do you mean with;

> <span macro="showWhenTaggedAny List">...

i.e what is this macro?

Thank you!

Amzg

unread,
Nov 27, 2009, 8:27:22 PM11/27/09
to TiddlyWiki
I'm really happy to say IT WORKS though!!!!!
I intend to put up a "conclusive" post here, but before I do;

As per your suggestion, I modified the ViewTemplate into;

<div class='toolbar' macro='toolbar
[[ToolbarCommands::ViewToolbar]]'></span><span macro='tiddler
MarksMarcoButton'></span></div>

...but this puts the MarksMarcoButton first in the tiddler menu. I
think it ought to be more hidden (it is not every day that you save
all tabs as bookmarks) so it should be under the "more▼" button.
However, doing the followign in ToolbarCommands does not work;

|~ViewToolbar|closeTiddler closeOthers +editTiddler deleteTiddler
references > fields syncing permalink MarksMarcoButton|

Thank you

BC

unread,
Nov 28, 2009, 1:46:40 AM11/28/09
to TiddlyWiki
On Nov 23, 12:07 pm, "Mark S." <throa...@yahoo.com> wrote:
> I haven't tried the FF plugin, but it sort looks like you should be
> able to make it produce a wikified output.

I haven't tried these solutions yet (way over my head, probably) and
as it happens, I broke the Firefox addon by installing the Firefox
beta. (they always kill my favorite extensions!) but if I remember
rightly, they had several kinds of markup available, including
mediawiki. Maybe the developer would be open to including tiddlywiki
markup. (all that's needed anyway is the "----" in the right place)
And anyway you can write your own syntax in the options (oh, and you
can easily have the description below the url. There's a box you just
uncheck.) But: I couldn't figure out how to get the "---" for the line
break to be inserted on a new line. The addon only lets you put a
blank line between items, it doesn't let you specify characters on new
lines. Since I use the addon to copy links to paste into other apps,
fancy markup wouldn't work for me, otherwise I'd use the html option
or something.
I'm really impressed with the ingenuity of people on this mailing
list. I look forward to trying out these strategies (but I have a lot
of learning to do to even understand them.)

BC

Reply all
Reply to author
Forward
0 new messages