|
Hi Dan,
first of all: It's definitely not my intention to be part of the heated part of the debate.
Only a few thoughts and a question:
I do not think that it is a big deal to press 7 keys ('mailto:') before writing an email address in the rich text comments field.
If this is too much for a user it's quite easy to write an - AHK - script that does the trick (that includes the writing of the email address automatically, too).
It's absolutely necessary that we do not get false positives if a user writes 'call boss@work' (the example from 'capital H').
But - this is the question - why should this happen?
If we put an email address in a word document like 'user@email.com' it will automatically be changed into a hyperlink (mailto:user@email.com). The user can see that if he moves the mouse over it.
It we put something like 'call boss@work' in a word document it will not be changed into a hyperlink.
Ergo: We do not get a false positive. 'call boss@work' doesn't follow the pattern of an email address (no dot, no extension).
Cheers,
Jochen
|
|
|
|
|
TCP_JM wrote: 'call boss@work' doesn't follow the pattern of an email address (no dot, no extension).
You make a good point, although the way I have written the URL detection is to look for specific URL types (eg. http://, mailto:, ftp://, ...) so it's not a trivial change to detect the suggested pattern and needs to be written so as not to incur a noticeable processing overhead.
|
|
|
|
|
I do not have a problem with 'mailto:user@email.com' in the comments field, not at all.
.dan.g. wrote: so it's not a trivial change to detect the suggested pattern
The integration of editable file-links that you are planning will then probaly not change 'user@email.com' automatically into 'mailto:user@email.com' and still show 'user@email.com'.
But can it be done manually by editing the hyperlink, then?
(e.g. in Word with the fields 'Address' and 'text to display'?)
|
|
|
|
|
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" ! Thumbs Up |
Problem here lies nether in realisation or coding it. Much less sophisticated taskmanagers have it.
Sigh | ---The Problem is: --- OMG |
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! Rose | [Rose]
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! Rose | [Rose]
Marc
|
|
|
|
|
I'd suggest to use a RegEx Search&Replace to put the mailto prefix as link into the comments:
Search: \b(?:mailto:)?([A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,6})\b
Replace: <a href="mailto:\1">\0</a>
But I don't know if Dan can implement this...
Best regards,
Martin
modified on Thursday, June 30, 2011 4:31 AM
|
|
|
|
|
I don't know if Dan could either, but...
Autohotkey certainly can:
#persistent
settitlematchmode,2
Settimer, SeekEmail,1000 ;frequency - change as you see fit.
return
SeekEmail:
IfWinActive AbstractSpoon ;only for TDL windows
{
StatusBarGetText, StatusBar , 4, AbstractSpoon
ControlGetText, Comment , RICHEDIT50W2, AbstractSpoon ;RICHEDIT50W2 is the comment control, both simple and rich text
CommentLen:=strLen(Comment)
if (statusbar=OldStatusBar) and (CommentLen=OldCommentLen) ;only performs its magic if statusbar part 4 changed, or Comment Length changed
Return
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, RICHEDIT50W2, %Comment%, AbstractSpoon
}
Return
The code checks every second if TDL is active, and if it is active, search the comment field for email addresses, replaces it with mailto: email addresses. The file is not saved (and does not even indicate that a change occurred). No guarantees are provided, and you use this code at your own risk.
BTW, I could not get your RegEx to work (although now that I think about it, it could be due to the absence of i)) but I got the RegEx expression from http://www.regular-expressions.info/email.html[^] (very last version) which I understand is one of the better ways to check for emails with RegEx.
Edit: Update to enhance performance - only runs the replacement if (1) task selected change (2) the length of the comments change
Edit2:Updated to reflect the full list of top level domains from http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains[^]. Probably not a big deal since I have never seen any of the additions
modified on Thursday, June 30, 2011 8:51 AM
|
|
|
|
|
capital H wrote: Autohotkey certainly can
Looks very impressive. Would you aggree that this script will be shown here:
http://abstractspoon.pbworks.com/w/page/41719939/AHK_Scripts[^]
If your answer is YES I would like to wait a day or so to see what other users might add or might say.
Thanks for your response in advance.
Cheers,
Jochen
|
|
|
|
|
Yes, I am cool with it.
Should I ever improve it I assume I can contact you to update the file/site? (It seems I cannot edit the wiki) There is probably a bunch of stuff that can be improved (e.g. not showing that file has changed, and performance may be an issue with large comment blocks)
|
|
|
|
|
capital H wrote: Yes, I am cool with it.
Highly appreciated.
capital H wrote: Should I ever improve it I assume I can contact you to update the file/site?
Of course! Any time.
I just looked through the code and I just start asking a (probably stupid?) question:
Is the functionality "limited" to these "extensions"
'com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum' ?
I'm asking because of email addresses like 'user@email.account.co.uk' and 'user@email.co.jp'.
|
|
|
|
|
TCP_JM wrote: I just looked through the code and I just start asking a (probably stupid?) question:
Believe me, when it comes to RegEx I feel very stupid
TCP_JM wrote: Is the functionality "limited" to these "extensions"
'com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum' ?
I'm asking because of email addresses like 'user@email.account.co.uk' and 'user@email.co.jp'.
I believe so. I am not going to claim that I understand RegEx, because I do not, the above is simply a copy and paste result. But my understanding is, it is to prevent false positives.
Please note as well that I updated the script above - it only replaces the email addresses if changes to the task selection or comment text occur.
Edit:
and apparently I missed a few. The full list is: http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains[^]
Note that it only filters for top-level domains, and these are the only allowed top level domains
Edit2: I have no clue how RegEx works, but apparently it allows ANY two letter country code (so it allows .aa but not .aaa). I think it is because of the {2} just before this string.
modified on Thursday, June 30, 2011 8:56 AM
|
|
|
|
|
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")
|
|
|
|
|