|
Thank you for your explanation.
capital H wrote: Please note as well that I updated the script above Thanks again.
I'm going to do some testing (e.g. with the {2} just before the string etc.).
I haven't the foggiest about RegEx but nevertheless: I try ... Maybe this leads to something ...
Cheers,
Jochen
|
|
|
|
|
I copied your updated code into a simple text file and called it 'email.ahk'.
Then I started the script and activated ToDoList, dragged the comments field with the mouse open and wrote:
user@email.com
user@email.net
Then I was waiting... But frankly nothing happened.
I was expecting to see:
mailto:user@email.com
mailto:user@email.net
Any idea?
Thanks in advance.
OS: GERMAN Win XP Sp3, ToDoList 6.2.6
|
|
|
|
|
I was still on TDL 6.2.3 when I created the script, the name of the control changed from 6.2.3 to 6.2.6
Change the two cases of RICHEDIT50W2 in the script to RICHEDIT50W1 (or use the code below)
(also your status bar should be visible for the script to work)
The code below I have also added a fix, if you have a huge comment field and the scan takes more than a second (or a slow computer...) then you would have had a crash... And the control name is now retrieved from the list of controls, the code should work as long as there is only one RichEdit control.
#persistent
settitlematchmode,2
Settimer, SeekEmail,1000 ;frequency - change as you see fit.
return
SeekEmail:
IfWinActive AbstractSpoon ;only for TDL windows
{
WinGet, ControlList , ControlList ;gets a list of all controls
Loop, Parse, ControlList, `n
{
if instr(A_LoopField,"RICHEDIT") ;we want a control with richedit in it (usually of the form RICHEDIT50WX where X is a number
{
CommentControl:=A_LoopField
break ;there should be only one...
}
}
StringReplace, CommentControl, CommentControl, `n ;clean
StringReplace, CommentControl, CommentControl, `r
StatusBarGetText, StatusBar , 4, AbstractSpoon
ControlGetText, Comment , %CommentControl%, AbstractSpoon
CommentLen:=strLen(Comment)
if (statusbar=OldStatusBar) and (CommentLen=OldCommentLen) ;only performs its magic if statusbar part 4 changed, or Comment Length changed
Return
Settimer, SeekEmail, Off ;turn of timer, just in case scan is very slow e.g. long comment field, with lots of email addresses
OldStatusBar:=StatusBar
OldCommentLen:=CommentLen
;NeedleRegEx:="i)\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)" ;simpler version checking for email
NeedleRegEx:="i)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum|cat|coop|info|int|pro|tel|travel|xxx)\b"
start=1
pos := RegExMatch(Comment, NeedleRegEx , email,1) ;search for email address
while(pos>0)
{
check=
if pos>7
Check:=SubStr(Comment, pos-7,7)
start:=pos+strLen(email)
if check<>mailto: ;a better way may be to check for newline/space/tab
{
Comment:=SubStr(Comment, 1 , pos-1) . "mailto:" . SubStr(Comment, pos) ;replace
start:=pos+strLen(email)+7 ;+7 for the insertion of mailto:
}
pos := RegExMatch(Comment, NeedleRegEx , email,start) ; search next occurence
}
ControlSetText, %CommentControl%, %Comment%, AbstractSpoon
}
Settimer, SeekEmail, On ;restore time
Return
|
|
|
|
|
Hi,
your script works like a charm with ToDoList 6.3.x but I can't get it running with 6.2.3 (you explained why) or 6.2.5 and 6.2.6 on my two computers.
[Update: For some reason it works now with 6.2.6. Maybe it helped that I rebooted the computer...]
Another good news:
Your script works with addresses like the ones below, too:
user@email.account.co.uk
user@email.co.jp
xy@xy.xy
So it's not limited to '|com|org|net|edu|gov|mil|biz| etc.'
And this is good news too:
Even this ('user@email.account.co.uk' and 'user@email.co.jp') will be changed correctly to:
mailto:'user@email.account.co.uk' and mailto:'user@email.co.jp'.
Great work !!!
BTW: I really appreciate it that it's not necessary that the file that contains your script (e.g. email.ahk) is stored in the ToDoList folder !!!
P.S.
The only thing I changed in your script was:
Settimer, SeekEmail,3000
It works better with one of my computes, because it's an old one...
modified on Friday, July 1, 2011 4:23 AM
|
|
|
|
|
I think Steves post is underestimated. I means its great that everyone is keen on working on a solution for his email idea. But this suggestion is actually the less important one!
Actually an @ recogniton would be sufficient. I think the ratio of occurence between having an emailadress in the comment and using by decision this abbreviations is significant. Again, an email adress you can´t change. Expressions like computer@work are easily to avoid. False Positives? Come on! You may get an extra link which makes you learn. No big deal. But great if you can make it work somehow!
I think time and energy can be more smart invested in the "validitything" !
Problem here lies nether in realisation or coding it. Much less sophisticated taskmanagers have it.
---The Problem is: ---
If you never worked with it, you can´t imagine.
If you can´t imagine, you do not miss it.
It was the one and only thing which made me switch back to MLO. But only for a while Dan!
Just imagine that your taskmanager is watching the clock and is displaying only those tasks you are able to perform here and now!
I think it´s perfectly implemented in MLO. Just take the time and look at it.
My priority of the flood of Steves good ideas would be (without knowing the effort needed!)
1. The location- and timesensitive display of tasks. (Relevant tasks only)
2. Editable Links (still on your list, Dan?)
3. Copy a format in the comments
4. Integration of additional icons (like .ico-files)
5. First suggestion of Steve. So you can edit a tasks fully, while displaying only the most relevant task attributes. Actually this should be 4. But i use a big screen!
6. Email thing.
Steve, come back, look how long your thread went. Most useful suggestions i have seen a long time! You reminded me that using, reading icons is fun!
Marc
modified on Friday, July 1, 2011 5:04 AM
|
|
|
|
|
Hi Marc,
Marc334 wrote: Actually an @ recogniton would be sufficient. I think the ratio of occurence between having an emailadress in the comment and using by decision this abbreviations is significant. Again, an email adress you can´t change. Expressions like computer@work are easily to avoid. False Positives? Come on! You may get an extra link which makes you learn. No big deal. But great if you can make it work somehow!
Read these two first, please
http://www.codeproject.com/Messages/3942927/Re-Experiences-with-6-2-5.aspx[^]
http://www.codeproject.com/Messages/3943279/Re-Experiences-with-6-2-5.aspx[^]
Now: Since Dan has told us that it is not a "not a trivial change to detect the suggested pattern" and Dan is already very busy with some bugs and his great plans for the future for ToDoList the solution does not lie in complaining but in finding a workaround for the time being, right?
So: The solution/the workaround that 'capital H' provides is very good and frankly I don't think that the difference between user@email.com and mailto:user@email.com is going to disturb your workflow. I suggest we should stay well grounded.
Next thing is:
I never replied to Steve and I told everybody that I do not want to be a part of the heated part of the debate. So maybe you are adressing the wrong guy by replying to my message.
|
|
|
|
|
Sorry, i thought this was still the thread about Steves suggestions. I copied my post more on top. I hope it´s less disturbing there.
I recognized how heated this email debate was getting and wanted to make sure that the other far more important features are not ignored over it.
Marc
P.S. I just tried out different typings in MS Word. It distinguishs between emailadresses and just strings with an @. I´m sure you guys know that already and are trying to mimik that algorhythm. Good luck and thank you!
|
|
|
|
|
Hi Marc,
Marc334 wrote: I hope it´s less disturbing there. It was never disturbing. No problem. I was just the wrong person ...
Marc334 wrote: I recognized how heated this email debate was getting and wanted to make sure that the other far more important features are not ignored over it. So it's good then that you've send your message again. Better twice than not at all.
Cheers,
Jochen
|
|
|
|
|
TCP_JM wrote: [Update: For some reason it works now with 6.2.6. Maybe it helped that I rebooted the computer...]
No I updated the script to work with 6.2.6
TCP_JM wrote: but I can't get it running with 6.2.3 (you explained why)
Actually my fix to work with 6.2.6 broke it working with 6.2.3
In version 6.2.3 there is a hidden RichEdit control that my script found, and tried to work with this control.
The code below now checks first of the control is visible, otherwise it continues to search for another control. Can you perhaps update the wiki?
Also, you can remove the line:
"The tasklist file will not be saved automatically after the every single change. It's the same as if you type a few new words in the comments field; ToDoList will not save your list automatically after every single change, too."
Although the asterisk does not appear to show the tasklist has changed, TDL does detect that a change has occured when you close the file (and subsequently asks to save)
You may want to add that the "Settimer, SeekEmail,3000" may be more appropriate on slow computers/large comment blocks
#persistent
settitlematchmode,2
Settimer, SeekEmail,1000 ;frequency - change as you see fit.
return
SeekEmail:
IfWinActive AbstractSpoon ;only for TDL windows
{
WinGet, ControlList , ControlList ;gets a list of all controls
Loop, Parse, ControlList, `n
{
if instr(A_LoopField,"RICHEDIT") ;we want a control with richedit in it (usually of the form RICHEDIT50WX where X is a number
{
CommentControl:=A_LoopField
ControlGet, isVisible, Visible, , %CommentControl% ;is the control visible or not?
if isVisible=0
CommentControl=
else
break ;stops if the control is visible
}
}
StringReplace, CommentControl, CommentControl, `n ;clean
StringReplace, CommentControl, CommentControl, `r
StatusBarGetText, StatusBar , 4, AbstractSpoon
ControlGetText, Comment , %CommentControl%, AbstractSpoon
CommentLen:=strLen(Comment)
if (statusbar=OldStatusBar) and (CommentLen=OldCommentLen) ;only performs its magic if statusbar part 4 changed, or Comment Length changed
Return
Settimer, SeekEmail, Off ;turn of timer, just in case scan is very slow e.g. long comment field, with lots of email addresses
OldStatusBar:=StatusBar
OldCommentLen:=CommentLen
;NeedleRegEx:="i)\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)" ;simpler version checking for email
NeedleRegEx:="i)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum|cat|coop|info|int|pro|tel|travel|xxx)\b"
start=1
pos := RegExMatch(Comment, NeedleRegEx , email,1) ;search for email address
while(pos>0)
{
check=
if pos>7
Check:=SubStr(Comment, pos-7,7)
start:=pos+strLen(email)
if check<>mailto: ;a better way may be to check for newline/space/tab
{
Comment:=SubStr(Comment, 1 , pos-1) . "mailto:" . SubStr(Comment, pos) ;replace
start:=pos+strLen(email)+7 ;+7 for the insertion of mailto:
}
pos := RegExMatch(Comment, NeedleRegEx , email,start) ; search next occurence
}
ControlSetText, %CommentControl%, %Comment%, AbstractSpoon
}
Settimer, SeekEmail, On ;restore time
Return
|
|
|
|
|
capital H wrote: Can you perhaps update the wiki? Done.
The wiki page you are looking at here:
http://abstractspoon.pbworks.com/w/page/41719939/AHK_Scripts[^]
is just part of the game.
The first page to look at would be:
http://abstractspoon.pbworks.com/w/page/4788732/AutoHotKey[^]
This page is a mixture of what I found there and what I added (there should be more information especially for newbies).
It should be possible to use the ToDoList menu 'help/ToDoList Wiki', too.
You get to the "Frontpage" of the wiki by that.
The link 'autohotkey' there leads at present to a 404 page.
'Told Dan about. So I assume it will be fixed in no time.
As you can see, we are just getting started. A lot of things have to be improved over time.
Ideas, remarks, advice, scripts (of course) etc. are very welcome.
Thanks again for providing this script
|
|
|
|
|
|
|
ToDoList's vote/rating has jumped to 4.93 because most of the 1's have been removed.
.dan.g.
AbstractSpoon Software
abstractspoon2_at_optusnet_dot_com_dot_au
modified on Saturday, June 25, 2011 8:11 AM
|
|
|
|
|
I'm not happy with the new rating. It's still below a perfect 5 which is what it deserves to have.
|
|
|
|
|
Cool! Also the Calendar plugin (albeit deceased ) has got a whopping 4.99! Woweeeeeeee!
Cheers
[d3m0n]
Email (replace "***" with "key")
|
|
|
|
|
|
|
I believe this has been addressed before and resolved for comments in rich text mode, but not for the simple text mode.
When copying text from a simple text comment and paste it into another application, a unwanted carriage return 0D0A is attached at the end of the text.
|
|
|
|
|
Actually, the simple text mode acts as it does by design.
There's a bug such that even if you select text containing a trailing carriage return, the richedit control seems to strip it off.
However, I'll see if I can fix it more intelligently.
|
|
|
|
|
6.2.6:
Seems to work perfect now, thanks!
|
|
|
|
|
Hi Dan,
The horizontal scrollbar in 'List View' "covers" the whole area from the first column (ID) to the last one (Title).
Would that be possible in 'Task Tree View', too?
In 'Task Tree View' the scrollbar "covers" only the last column (Title).
It would be great if the user could open the comments field (by dragging it open with the mouse) and could scroll in the same way through the columns in 'Task Tree View' as he can in 'List View'.
Thank you very much for considering this.
Cheers,
Jochen
|
|
|
|
|
That will come as part of replacing the current task-tree with something better.
|
|
|
|
|
Thanks for your reply. It'll have to wait then.
|
|
|
|
|
Today, the statusbar of my tasklist shows 2067 sessions with 5387 tasks (in my case, the better word instead of 'tasks' would be 'entries' as I use my tasklist not only to manage tasks, but also as a data base).
Until now, TDL has NEVER crashed or freezed, and I never had any loss of data. And: 6.2.5 is running faster than ever! When I read about all the planned features and functionalities in the future, I do hope that those will not sacrifice the present speed.
After this chorus of praise, here are some feature requests which would make my daily life with TDL more productive:
1. I use the combination of 'Start Date + Due Date' to indicate the beginning and the end of a project, as well as I use 'Due Dates' only for daily appointments.
With this logic, I'd like to see *both* Start Dates *and* Due Dates that are due within the next 7 days in one filter view.
With the regular filter, I cannot see both at the same time.
No problem, I don't use the regular filter anyhow because the filter function integrated in 'Find Tasks' offers much more flexibility. However, I am missing the relative date selections that the regular filter is now offering, like 'Within the next 7 days'. Can you implement this into 'Find Tasks' please ?
2. Regarding the 'Including' options' that Find Tasks offers: I am missing the option 'Including subtasks'.
3. The statusbar shows how many tasks are selected plus the task ID.
I would be great to see how many sub-tasks are under the selected task(s), for example:
1 task selected (257) with 57 subtasks
-or-
2 tasks selected with 67 subtasks total
4. Last not least a simple one: Can you give me the hotkey for 'Pasting a task ABOVE the selected task ?
As always, thank you for considering my feature requests.
Klaus
|
|
|
|
|
verithin wrote: I do hope that those will not sacrifice the present speed.
It is my sincere intention to always keep one eye on TDL's speed, and I believe that the proposed changes will actually make it easier for me to evaluate TDL's performance and to add appropriate optimizations.
verithin wrote: However, I am missing the relative date selections that the regular filter is now offering, like 'Within the next 7 days'
There is a proposal to allow the user to enter dates in the form '+10d', 'm+1', etc. I just have to figure out how best to do it from a user perspective.
verithin wrote: I am missing the option 'Including subtasks'.
Should be trivial.
verithin wrote: would be great to see how many sub-tasks are under the selected task(s),
Presumably we count nested sub-tasks (grand children), but do we count the subtask itself that contains subtasks?
ie.
Task A
Task A.A
Task A.B
Task A.C <------------ do we count this or only leaf tasks (tasks having no subtasks)?
Task A.C.A
Task A.C.B
verithin wrote: Can you give me the hotkey for 'Pasting a task ABOVE the selected task ?
I'll need to add another menu item, so this'll have to wait for 6.3.
|
|
|
|
|