Question: Issue about links in comments with enhanced text format

37 views
Skip to first unread message

Thierry Camus

unread,
Jan 29, 2019, 11:00:20 AM1/29/19
to abstractspoon-t...@googlegroups.com

Good afternoon Dan,


I have an issue with linked files in comments, I use a lot of this links, and some time I need to move an entire root directory for archive. What I do, it's open the tdl file with a notepad (i know this is not well :-) ) to replace all directories path by the new one with archive inside ..../Archive/...

 

And what I saw is that if the comments are in simple text everything goes well, but if the comments are in enhanced text then the replace doesn't do the expected behavior when I open the file with todolist.

 

I found that the enhanced text have  <CUSTOMCOMMENTS> </CUSTOMCOMMENTS> tag in addition simple text. The value inside this tags is not 'human readable' .

 

So my question is how can I do a replace c:\MyRootDir\Dir1 by c:\MyRootDir\Archive\Dir1 in the CUSTOMCOMMENTS tag area ?


Is there a way to decode, replace and re-encode this tag ?


Even if i need to write a script to do it.

 

Thank you, for this very useful software

TonyG

unread,
Jan 29, 2019, 5:15:07 PM1/29/19
to ToDoList (AbstractSpoon) Support
Thierry, do you have any coding experience?
How would you like something like this to work, if not in Notepad?
I think I can create a UDT that will do a search/replace of text within COMMENTS and the CUSTOMCOMMENTS tags = richtext field.

Dan, I have an algorithm in C# to decode/encode. rather than something that manipulates the DOM or does object-oriented manipulation like my library, I'm thinking a UDT can do the following:
1) Force a save of the current .tdl and get a backup.
2) Do a "dumb parse" for a CUSTOMCOMMENTS node.
3) Decrypt, search/replace, Encrypt.
4) Replace the node.
5) Repeat 2-4 as required.
6) Get a backup and force a refresh of the .tdl.

Dan - would you propose something different?
I thought there was a search/replace, but I see that's only for the task titles, not comments.

Best,
T

.dan.g.

unread,
Jan 29, 2019, 9:05:20 PM1/29/19
to abstractspoon-t...@googlegroups.com
Hi Thierry

Unfortunately the custom comments is a binary format that is compressed and encoded into the taskfile, so find/replace can never work.

>> and some time I need to move an entire root directory for archive

Is that because all your links have absolute paths? eg. <file:///D:/_Downloads/...>

If so, the longer term solution might be to start using paths relative to the tasklist eg. <file:///Sub folder/Introduction_Log.csv>

For a possible solution in the short term, have a look at my comments on Tony's reply.
 
Dan

.dan.g.

unread,
Jan 29, 2019, 9:25:05 PM1/29/19
to abstractspoon-t...@googlegroups.com
>> Dan - would you propose something different?

No, I think your suggested workflow covers it.

Some comments:

>> 1) Force a save of the current .tdl and get a backup.

a) There is a UDT preference to save tasklists before running (or you could run TDL with "-cmd 32816")
b) You can create a backup just by copying the existing tasklist

>> 2) Do a "dumb parse" for a CUSTOMCOMMENTS node.

Bearing in mind that I will be releasing an 'HTML' comments plugin in 7.3, so in time it will also be necessary to check the 'COMMENTSTYPE' attribute...

>> 6) ... and force a refresh of the .tdl.

a) Probably easiest just to rely on the file-change-reload mechanism within TDL 

Dan

Thierry Camus

unread,
Jan 30, 2019, 10:08:39 AM1/30/19
to ToDoList (AbstractSpoon) Support

Thank you for your answers,

 

Tony, what you suggest was what i thought should be done, I haven't a very good knowledge in programming, but with time I can do little things in C# or VB and xslt.

 

Dan, yes my links are absolutes I make them by drag and drop on the comments area, thing I find very useful. But I think than the relatives path are not a solution for my case, because I move directories or files but not the todolist's file.

 

I think, I'm not alone that be in front of this problem so if my question can help somebody else

 

The 'HTML' comments plugin in 7.3 which will be done, does it do the search-replace in the enhanced comments ? If yes I just waiting than the new release is publish.

 

I'm using todolist since many years now, and each time I  had to move directories I lost the comments format. So one or more times more is not a big deal.

 

A big thanks for your answers and software

.dan.g.

unread,
Jan 30, 2019, 7:53:45 PM1/30/19
to ToDoList (AbstractSpoon) Support
>> does it do the search-replace in the enhanced comments

Not in the way that would help you unfortunately, but I'll give it some thought and see if I can work something out.

>> If yes I just waiting than the new release is publish.

FYI, 7.3 is at least 6-9 months away although its initial 'Development Preview' will be much sooner.

.dan.g.

unread,
Feb 3, 2019, 3:51:41 AM2/3/19
to ToDoList (AbstractSpoon) Support
Hi Thierry

FWIW, I've figured out how to achieve this in 7.3.


On Wednesday, 30 January 2019 03:00:20 UTC+11, Thierry Camus wrote:
Reply all
Reply to author
Forward
0 new messages