|
Fixed in 6.3.b2
.dan.g.
AbstractSpoon Software
abstractspoon2_at_optusnet_dot_com_dot_au
modified on Saturday, August 6, 2011 7:43 AM
|
|
|
|
|
Thank you! Very good.
|
|
|
|
|
The 4 scripts below are meant as an addition to the 2 options ‘Toggle’.
Many thanks to 'capital H', who pointed me in the right direction and helped to improve the script with regard to content and the visual appearance
Preliminary notes:
* The 4 scripts work whether you choose to see the StatusBar or not (menu: View / ‘Show Status Bar’).
* The shortcuts/hotkeys can easily be changed but you shouldn’t use {F10} or {F11} without [Shift], [Ctrl], [Alt] or [Win] as a hotkey unless you want to kill the implemented ToDoList ‘Toggle’ options. BTW: {Shift}+{F10} (without using this hotkey for script 1) usually opens context menus. I do not need that. But if you do you can easily change the hotkey(s).
* Put the 4 little scripts in your "alwayson" script (=a script that gets launched with or before ToDoList and runs all day long)
* “foolish” assumption: you want to use the scripts while working with ToDoList
* the 4 scripts do not depend on each other.
* Abbreviations: Task Tree View = TTV, List View = LV, ‘Comments field’ = CF
* the scripts will need a little changing if ToDoList (Version 6.3 et seqq.) is localized. You'll find a 'how to' at the end of this message. It's not difficult.
The idea:
ToDoList offers two options to change the view (respectively to put the focus on TTV, LV or CF)
{F10} toggles between TTV and LV
{F11} toggles between Tasks and CF
One day I got the idea that it would be useful to have an alternative that allows me to address the views directly.
Dan introduced me to the fact that “the idea in well designed UI software is to reduce the number of choices so that the user is not overwhelmed”.
I thought about that and found a way to meet both requirements.
Description:
With the ‘Toggle’-option the user has to answer three questions:
Where am I? (=looking for the cursor) Where do I want to go? What do I have to do (in this special situation) to get there?
A single example:
(No mouse involved, because most of the users who are working fast aren’t using the mouse very often):
A user works in ListView and uses {F11} to toggle between the ListView and the ‘comments field’.
After working in the CF he decides to go to the TaskTreeView. Let’s assume he gets interrupted (very likely in a “modern” work environment) and gets back to work with his computer after some time. He will (hopefully) still remember that he finished working in the comments field.
His thoughts have to be:
Where am I? -> (He has to look on the screen) Still in the comments field.
Where do I want to go? -> TaskTreeView.
What do I have to do in this special situation to get there? -> First I have to use {F11} to go back to the ListView and then I have to use {F10} to toggle to the TaskTreeView.
My scripts (following the idea that the number of choices should be reduced) allow the user to reduce the number of questions to one: Where do I want to go? -> TaskTreeView -> One Hotkey. Done.
Last but not least: What happens if the user has already changed the view to TaskTreeView before he got interrupted, forgot that and presses the hotkey for TTV again? Nothing. He stays right there where he is: in TaskTreeView. (It’s the same with LV and CF, but as an exception not if you use script 4).
The Code:
; Script 1 – activates TASK TREE VIEW or stays there
SetTitleMatchMode 2
#IfWinActive, AbstractSpoon
+F10::
StatusBarGetText, StatusBar , 8, AbstractSpoon
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
return
#IfWinActive
; Script 2 - activates LIST VIEW or stays there
SetTitleMatchMode 2
#IfWinActive, AbstractSpoon
+F11::
StatusBarGetText, StatusBar , 8, AbstractSpoon
if StatusBar = Tasks: Comments
{
PostMessage, 0x111, 33243,,, AbstractSpoon
StatusBarGetText, StatusBar , 8, AbstractSpoon
if StatusBar = Task Tree
PostMessage, 0x111, 33238,,, AbstractSpoon
}
if StatusBar = Tasks: Task Tree
PostMessage, 0x111, 33238,,, AbstractSpoon
return
#IfWinActive
; Script 3 - activates ‘Comments field’ or stays there
SetTitleMatchMode 2
#IfWinActive, AbstractSpoon
+F9::
StatusBarGetText, StatusBar , 8, AbstractSpoon
if (StatusBar = "Tasks: Task Tree") or (StatusBar = "Tasks: List View")
PostMessage, 0x111, 33243,,, AbstractSpoon
return
#IfWinActive
; Script 4 - activates ‘Comments field’ or stays there and maximizes the ‘comments field’ resp. minimizes it again (and in this case sets the focus back to ListView or TaskTreeView)
SetTitleMatchMode 2
#IfWinActive, AbstractSpoon
^F9::
StatusBarGetText, StatusBar , 8, AbstractSpoon
if (StatusBar = "Tasks: Task Tree") or (StatusBar = "Tasks: List View")
PostMessage, 0x111, 33243,,, AbstractSpoon
SendMessage, 0x111, 33258,,, AbstractSpoon ; maximizes the comments resp. minimizes the comments
PostMessage, 0x111, 33243,,, AbstractSpoon
; This last command puts the focus back to TTV or LV. If you dislike this disable it with ‘;’ or delete it.
; I’m using script 4 if I’m working in TTV or LV and want to go directly to a maximized CF and back
; to the task list. Ctrl+Shift+m doesn’t put the cursor back in the task list.
return
#IfWinActive
As always:
Any idea how to improve the scripts is very welcome. Thanks for sharing your ideas / solutions.
P.S.
Localisation
Dan pointed out that that the scripts will need changing if TDL is localized (thanks Dan!).
The reason is that the script queries information that is shown in the 'Status Bar'.
If these informations in the 'Status Bar' are not shown in English, because ToDoList has been translated into another language the scripts won't work without modification.
To change the scripts look for 'if StatusBar =' in the text of the script.
In the English version you see 'Tasks: Task Tree', 'Tasks: Comments', 'Tasks: List View' or just 'Task Tree', 'Comments', 'List View'. This refers to what the 'Status Bar' of ToDoList shows.
To change the scripts you just have to change 'Tasks: Task Tree' etc. to the text that your 'Status Bar' shows. That's all!
|
|
|
|
|
Good job Jochen!
Some comments.
1)
It might be better in some instances to use sendMessage (to replace postmessage)
PostMessage sends the message tot he window you want, and immediately returns. SendMessage waits for its successful execution.
For example in Script4
PostMessage, 0x111, 33258,,, AbstractSpoon ; maximizes the comments resp. minimizes the comments
PostMessage, 0x111, 33243,,, AbstractSpoon
You might be better of with SendMessage here, especially on a slow computer or if the computer is busy with stuff in the background.
2)
if StatusBar = Tasks: Task Tree
PostMessage, 0x111, 33243,,, AbstractSpoon
if StatusBar = Tasks: List View
PostMessage, 0x111, 33243,,, AbstractSpoon
Can be replaced with
if (StatusBar = "Tasks: Task Tree") or (StatusBar = "Tasks: List View")
PostMessage, 0x111, 33243,,, AbstractSpoon
3) For your known issue, try
AutoFocus()
{
loop,9
{
ControlGet, isVisible, Visible, , SysTreeView32%A_Index%,AbstractSpoon ;is the control visible or not?
if isVisible
{
ControlFocus, SysTreeView32%A_Index%, AbstractSpoon ;Focus on TreeView
return "TreeView" ;Let caller know treeview has focus
}
ControlGet, isVisible, Visible, , SysListView%A_Index%, AbstractSpoon ;is the control visible or not?
if isVisible
{
ControlFocus, SysListView32%A_Index%, AbstractSpoon ;Focus on ListView
return "ListView" ;Let caller know Listview has focus
}
}
return ""
}
Note that the statusBar is not updated when this function is run, but it focus on the treeview or the listview (depending on which control is visible) and return this to you.
Known issue: It will only work for the first 9 controls, as I do not know how the controls will be named after 9, and am too lazy too test.
Hope this helps.
H
|
|
|
|
|
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.
|
|
|
|
|