|
Hi H,
your comments are and your help is very much appreciated. As always. Thank you.
1.) I'll try SendMessage instead of PostMessage.
The script works (even on my very slow computer that I'm using for the Internet; this is always my
"test object") but you're right of course. The script should work on slower computers too or if the computer is busy with stuff in the background.
2.) That I didn't use 'if (StatusBar = "Tasks: Task Tree") or (StatusBar = "Tasks: List View' is a very good sign that I'm still a beginner...
3.) About the "known issue":
I will definitely test 'AutoFocus'. Thanks again.
I'm still trying to find a way to get the focus on the view back after minimizing ToDoList and maximizing it again. WinActivate doesn't help, because the window gets the focus back but not the view.
I mentioned {F2}{Escape} as a way to get the focus back on TaskTreeView or ListView (depends on what you worked with resp. what was visible before minimizing ToDoList). But that doesn't give me the focus back if I was working in the comments field before minimizing ToDoList.
Another way to get the focus back is {F11} - or the MessageCode equivalent for toggling between Tasks and Comments (33243). But obviously: no focus on the 'comments field', too.
I think it would be a lot better if ToDoList wouldn't lose the focus regarding the view.
I'm sure there is a way to solve this.
@Dan: Can this considered to be a bug? I would like to ask you to change this behaviour of ToDoList, please. Thank you very much in advance for your help.
Cheers,
Jochen
|
|
|
|
|
Hi H,
The problem regarding the 'known issue' is solved (ToDoList version 6.3.b3).
Dan made sure that ToDoList doesn't lose the focus on comments, task tree and list view anymore.
Btw: it's the same with the editing controls.
Cheers,
Jochen
|
|
|
|
|
comment 4
I would change
+F10::
SetTitleMatchMode 2
WinWaitActive, AbstractSpoon
Stuff...
to
SetTitleMatchMode 2
#ifwinActive, AbstractSpoon
+F10::
Stuff...
The first version is a global hotkey. Let's say the user press Shift+F10 in MS Word.
Your hotkey will be fired, and will wait indefinitely for AbstractSpoon to become active. Once it is active the rest of the script will execute
Lastly a very small thing:
The indentation you use in the first two hotkeys is very confusing (especially for anyone who has ever worked with Python!)
Consider reading:
if StatusBar = Tasks: Comments
PostMessage, 0x111, 33243,,, AbstractSpoon
StatusBarGetText, StatusBar , 8, AbstractSpoon
if StatusBar = List View
PostMessage, 0x111, 33238,,, AbstractSpoon
if StatusBar = Tasks: List View
PostMessage, 0x111, 33238,,, AbstractSpoon
and:
if StatusBar = Tasks: Comments
PostMessage, 0x111, 33243,,, AbstractSpoon
StatusBarGetText, StatusBar , 8, AbstractSpoon
if StatusBar = List View
PostMessage, 0x111, 33238,,, AbstractSpoon
if StatusBar = Tasks: List View
PostMessage, 0x111, 33238,,, AbstractSpoon
(You can even bring in the or statement here to combine the last two ifs)
|
|
|
|
|
Hello H,
thanks again.
capital H wrote: Your hotkey will be fired, and will wait indefinitely for AbstractSpoon to become active. Once it is active the rest of the script will execute Very true. I will have to change this.
Regarding the indentation.
I trust you with this, but I'm a little confused now.
This version is a lot easier to read (for me):
if StatusBar = Tasks: Comments
PostMessage, 0x111, 33243,,, AbstractSpoon
StatusBarGetText, StatusBar , 8, AbstractSpoon
if StatusBar = List View
PostMessage, 0x111, 33238,,, AbstractSpoon
if StatusBar = Tasks: List View
PostMessage, 0x111, 33238,,, AbstractSpoon
The reason is that the second 'if' is still a part (kind of a subcommand) of the fist 'if'. Beginning with 'StatusBarGetText' and ending two lines later with 'AbstractSpoon'. So I've indented everything that belongs to the first 'if'.
This indentation confuses me:
if StatusBar = Tasks: Comments
PostMessage, 0x111, 33243,,, AbstractSpoon
StatusBarGetText, StatusBar , 8, AbstractSpoon
if StatusBar = List View
PostMessage, 0x111, 33238,,, AbstractSpoon
if StatusBar = Tasks: List View
PostMessage, 0x111, 33238,,, AbstractSpoon
The second 'if' looks like it is on the same level as the first and the third 'if'.
Cheers,
Jochen
|
|
|
|
|
About the indentation:
Apologies if I caused confusion - I misunderstood your intention
AHK does depend on indentation (unlike Python) so
if x=y
x=1
x=2
and
if x=y
x=1
x=2
is equivalent
What I now understand is that you want (note the use of the curly braces - it groups the commands together. Without it, the Statusbargettext will always be executed):
if StatusBar = Tasks: Comments
{
PostMessage, 0x111, 33243,,, AbstractSpoon
StatusBarGetText, StatusBar , 8, AbstractSpoon
if StatusBar = List View
PostMessage, 0x111, 33238,,, AbstractSpoon
}
if StatusBar = Tasks: List View
PostMessage, 0x111, 33238,,, AbstractSpoon
|
|
|
|
|
capital H wrote: I misunderstood your intention I'm sorry. My fault is that I didn't use the curly braces. No wonder that you misunderstood my intention.
Many thanks again for your help!
|
|
|
|
|
capital H wrote: I would change
+F10::
SetTitleMatchMode 2
WinWaitActive, AbstractSpoon
Stuff...
to
SetTitleMatchMode 2
#ifwinActive, AbstractSpoon
+F10::
Stuff...
The first version is a global hotkey. Let's say the user press Shift+F10 in MS Word.
Your hotkey will be fired, and will wait indefinitely for AbstractSpoon to become active. Once it is active the rest of the script will execute
I changed the script according to your advice and another problem occured.
My alwayson-script (ie 'all.ahk') doesn't only contain scripts for ToDoList:
If I put:
SetTitleMatchMode 2
#ifwinActive, AbstractSpoon
before the hotkey
+F10::
{Shift}+{F10} ist not longer a 'global hotkey' but
SetTitleMatchMode 2
#ifwinActive, AbstractSpoon
becomes some sort of 'global rule' for the whole alwayson script. Even if these two lines are just part of one single script in the whole alwayson-script.
As a result of that I cannot use scripts that were meant for other apps any more because every single script in the alwayson script works only if ToDoList is active.
Hmm...
|
|
|
|
|
Can you try:
SetTitleMatchMode 2
#ifwinActive, AbstractSpoon
+F10::
Stuff...
return
#ifwinActive
I.e. add #ifwinActive, at after your return
I forgot that (from the AHK help) "The #IfWin directives are positional: they affect all hotkeys and hotstrings physically beneath them in the script. They are also mutually exclusive; that is, only the most recent one will be in effect."
|
|
|
|
|
Many thanks for this solution.
I tested '#ifWinActive' after 'return' and it seems to work like a charm.
Thanks for quoting the AutoHotkey.chm.
Don't think I'm lazy, please. I wouldn't use up your time to save my time.
I read the text in the AHK help file but ... Now I get the meaning of the English sentence you quoted.
It's a little "reassuring" that I found a few messages in the 'AutoHotkey Community Forum' that show that others have problems with #ifWinActive, too...
Tonight I'm going to start to rewrite the script and put it to the acid test
It was easier than expected. Did it in my lunch time. Modifications are now available.
|
|
|
|
|
Don't worry both of us learned something today.
I went to update my always on script, luckily all my global hotkeys were on top, the #ifwinactives were all beneath them.
|
|
|
|
|
Another subject.
I'm sure you remember that we talked about "toggling" the 'word wrap', 'show formatting toolbar' and so on.
You wrote:
In theory the following should work to toggle word wrap:
SetTitleMatchMode,2
#IfWinActive, AbstractSpoon
F6::
SendMessage, 0x111, 33068 ;fails
;SendMessage, 0x111, 33068,,RICHEDIT50W1, AbstractSpoon ;Try sending directly to the comment control - also fails
return
However it is not working for me.
(Ruler should be 32777 and toolbar 32776 - replace 33068 with these numbers)
It is not necessary to detect the current state - as these commands should toggle the state.
Tried to find a solution for this and "discovered" something.
If you right click in the comments field you get a context menu, but what you don't see then is that some of the commands have shortcuts!
If you use {Shift}+{F10} instead - assuming that this is not blocked by my script - you get the same context menu but this time you can see that some of the commands have shortcuts.
Knowing this it's "relativly" easy to toggle 'show formatting toolbar' and 'show ruler'
SendInput, {Shiftdown}F10{Shiftup}ff{enter}
respectivly
SendInput, {Shiftdown}F10{Shiftup}r ; you do not need {enter} here.
If there is already text in the 'comments field' you need
SendInput, {Shiftdown}F10{Shiftup}rr{Enter}.
But it doesn't help with 'word wrap' because 'word wrap' doesn't have a shortcut. At least I couldn't find one.
But I found out that {Shift}+{F10},{p} puts text from the clipboard in the 'comments field'...
ToDoList is always very useful and appreciated but sometimes a miracle to me...
|
|
|
|
|
Bear in mind too, that the scripts will need changing if TDL is localized.
|
|
|
|
|
Hi Dan,
thank you for your advice.
What exactly do you have in mind? The text of the "Status Bar" or something else?
What do you suggest to support e.g. people from Tibet?
Cheers,
Jochen
|
|
|
|
|
It just means that people using a German translation, say, would need to modify the script to look for the German translation of 'Tasks: Task Tree'. No easy way around this.
|
|
|
|
|
.dan.g. wrote: It just means that people using a German translation, say, would need to modify the script
Yep. I assumed that you were talking about that.
.dan.g. wrote: No easy way around this
Not very easy, but easy (at least not complicated). I will add an information about how to modify them. Thanks again for the advice.
The language of your 'Code Project ToDoList Page' and the language of AHK is English.
I assume that most of the people who are using ToDoList are able to speak (a little) English and can help themselves with a proper explanation how to change the scripts.
If ToDoList is offered (after translating it into e.g. Tibetan) on a Website I do hope that the one who offers it will be kind enough to offer all the scripts (not only mine, of course) that need partially a modification in the modified version, too.
|
|
|
|
|
Please check
if (!pTDI || !pTDI)
instead (!pTDI || !pTDS) in ToDoCtrlData.cpp (twice) and add another %s in TaskListTxtExporter.cpp for ENDL in sItem.Format() at line 206
Thanxs for your valuable work.
|
|
|
|
|
|
Get it Here.
Changes
Substantial improvements in loading and saving performance.
1. Loading smaller tasklists (500 tasks) is more than 2x faster than 6.2.8 (900ms vs 2000ms).
2. Loading larger tasklists (2000 tasks) is more than 3x faster than 6.2.8 (5600ms vs 17800ms).
3. Saving tasklists (of any size) is of a comparable speed to 6.2.8.
However there is still an unexplained degradation in saving performance as the number of tasks increases. eg 4x the number of tasks produces a 16x time to save.
.dan.g.
AbstractSpoon Software
abstractspoon2_at_optusnet_dot_com_dot_au
modified on Sunday, July 31, 2011 9:23 PM
|
|
|
|
|
Hi Dan,
ToDoList 6.3.a8 resp. 6.3.a9
OS: Win XP, Sp3
The steps:
Menu: Tools / Import tasks
Format: ToDoList (*.tdl)
Import from: File (e.g ...\Introduction.tdl)
Import to: New tasklist (or 'Selected task in active tasklist')
Click on 'Import', please
In the new window (='Import tasks') all the tasks are selected.
Choose: 'Select None'
Then select the first task (This is a task')
'Reset creation date to today' is enabled.
Press 'OK'
Result:
In 6.3.a8 -> Boom. ToDoList crashes.
In 6.3.a9 -> an error message pops up:
"The exception unknown software exception (0x00000fd) occurred in the application at location 0x7c91eddc."
And then: Boom.
Cheers,
Jochen
|
|
|
|
|
|
6.3.a9 (Unicode)
Unicode build loading Ansi tasklists:
Loading '500_Tasks.tdl' took 891 ms
Loading '1000_Tasks.tdl' took 2156 ms
Loading '1500_Tasks.tdl' took 3766 ms
Loading '2000_Tasks.tdl' took 5640 ms
Unicode build saving Ansi tasklists:
Saving '500_Tasks.tdl' took 235 ms
Saving '1000_Tasks.tdl' took 860 ms
Saving '1500_Tasks.tdl' took 1969 ms
Saving '2000_Tasks.tdl' took 4797 ms
Unicode build loading Unicode tasklists:
Loading '500_TasksU.tdl' took 1000 ms
Loading '1000_TasksU.tdl' took 2156 ms
Loading '1500_TasksU.tdl' took 3765 ms
Loading '2000_TasksU.tdl' took 5750 ms
Unicode build saving Unicode tasklists:
Saving '500_TasksU.tdl' took 219 ms
Saving '1000_TasksU.tdl' took 828 ms
Saving '1500_TasksU.tdl' took 1937 ms
Saving '2000_TasksU.tdl' took 3454 ms
Vast improvements I'm sure you'll agree. I'll release 6.3.a9 tonight so that others can check my results if they choose.
ps. I'm also going to continue to explore why performance degrades so much with increasing number of tasks.
|
|
|
|
|
This is great news! Glad to see the Ansi vs Unicode is now near near equivalent in performance (which means that you do not have to choose based on performance!)
Still some non-linear slowdown (e.g. U+U - x17 slowdown with x4 tasks)
|
|
|
|
|
I've discovered that the last thing I do before saving the file to the disk is to add a newline between every task ie. I replace "><" with ">{newline}<", and that on a 2000 task tasklist this can take more than 1 second to perform. And the time taken is a non-linear progression.
Unfortunately, removing this change makes tasklists un-humanly-readable. I will research whether I can get the MSXML component to perform this operation automatically.
|
|
|
|
|
Does the "Always sort completed tasks below other tasks" work in 6.2.8? I have the check box selected in preferences but not seeing any results. Seems simple enough...am I missing anything?
Thanks,
Jp
|
|
|
|
|
JoelPutnam wrote: Seems simple enough...am I missing anything? I'll look into it.
|
|
|
|
|