How to change the title of every non-system tiddler

81 views
Skip to first unread message

JWHoneycutt

unread,
May 4, 2018, 6:00:36 PM5/4/18
to TiddlyWiki
I would like to import a large group of tiddlers into another wiki, but can't guarantee there aren't a few with the same title, and I do not want overwrites.

So I simply want to change the title of every (nonsystem) tiddler in the export file to add a prefix of "." (period)

It sounds like it should be easy but I am not there yet.

My best guess is:
1) Use fieldmangler widget to add message field "title2" 
2) Use addprefix to add "." to "title" and place it into title2
3) Replace "title" with "title2"

As always, any thoughts are appreciated
JWHoneycutt

Mark S.

unread,
May 4, 2018, 6:42:28 PM5/4/18
to TiddlyWiki
Definitely make backups before trying any of this!

This code will make a copy of your tiddlers. Change the filter to match your criteria. The reason it makes a copy is because the title field is central to everything in TW, so when you try to change the field a copy is made. After you've made the copies, export your tiddlers based on the "." prefix.

<$button>Make . Tiddlers
<$list filter="[tag[HelloThere]]">
<$list filter="[all[current]addprefix[.]]" variable="pre">
<$action-setfield $field="title" $value=<
<pre>>/>
</$list>
</$list>
</$button>


Then, to clean up, delete the "dot" tiddlers with this:

<$button>Delete . Tiddlers
<$action-deletetiddler $filter="[all[tiddlers]prefix[.]]"/>
</$button>


Note that the dot tiddlers will no longer be linkable with each other (if they had links) and if they had a role as tag tiddlers that will be broken also.

Oh yes. I'll say it again -- make backups!

HTH
-- Mar

JWHoneycutt

unread,
May 5, 2018, 7:08:47 AM5/5/18
to TiddlyWiki
@Mark S. 

Thank you so much! 
Yes, I knew that the title is crucial to TW5 function, which is why I wasn't sure how to proceed.

I really appreciate your help.
JWH

TonyM

unread,
May 5, 2018, 8:32:37 AM5/5/18
to TiddlyWiki
JW,

There may be another solution. Install Mario's bundler plugin and in its settings you can choose to overwrite existing tiddlers or rename them on import if you are using bundles or not.
.

Regards
tony
Reply all
Reply to author
Forward
0 new messages