|
Sounds great. I like the focus on the underlying structure to provide more flexibility for a 'view based' approach to the lists.
Thanks Dan!
|
|
|
|
|
Interestingly I often feel some anxiety when one version is released and another just about to start, especially when there's structural work to be done. It's kind of like replacing the foundations of a house and not being certain that the house will still be standing when it's done...
|
|
|
|
|
Dan,
Really looking forward to the outcomes of this.
I agree with some of the others here - your work-rate is mucho impressive.
|
|
|
|
|
Hi Dan,
I tried to solve this with ToDoList and Autohotkey but I couldn't find a way.
If the user minimizes e.g. WinWord to the taskbar by clicking on the minimize button in the title bar and maximizes Word again by clicking on the Word item in the taskbar he can start writing immediately.
If the user works in the 'comments field' of ToDoList, minimizes ToDoList to the taskbar and maximizes the ToDoList window again it's different. The focus is lost. The ToDoList window itself has a focus but the 'comments field' lost it.
To go on working in the 'comments field' after maximizing ToDoList the user has to use the mouse that is to say he has to click in the comments field. Then he can start writing.
[To compare that with Winword again: If WinWord would work in the same way as ToDoList does at the moment the user couldn't start writing after maximizing WinWord without clicking in the text part (the Word document) before.]
There is no direct way (at least I couldn't find one) to "activate" the 'comments field' after maximizing ToDoList with the keyboard.
It's the same if the user worked in the TaskTreeView or in the Listview before minimizing ToDoList and maximizing it again. The Focus is lost and therefore the user can't use the arrow keys to move in the tasklist before clicking with the mouse on one task.
- - -
I've done some testing that doesn't solve the problem but shows some interesting results that might help you.
[To see these results you might want to test the little AHK script that I've written for that (see below) ].
1.) Cursor is in the 'comments field' before minimizing ToDoList
Test:
Minimize ToDoList by clicking on the minimize button in the title bar but maximize ToDoList by using the script (= the hotkey).
Result:
ToDoList doesn't focus on the 'comments field' but on the tasklist. The user can use the arrow keys immediately to move the cursor.
2.) Cursor is in the tasklist before minimizing ToDoList
Test:
Same test as 1.)
Result:
Same result as 1.).
3.) Cursor is in the 'comments field' (CF) before minimizing ToDoList
Test:
Minimize ToDoList by using the script and maximize it again by using the script (no mouse clicks involved here).
Result:
ToDoList doesn't lose the focus. The cursor is still in the 'comments field'. It's getting better: The cursor remains excatly in the position he had before minimizig ToDoList even if the user works in other (non-ToDoList)windows in between. The cursor is not on position {home}.
The code:
#m::
; used [Win]+[m] because it does the same as [Win]+[d]. One Option to minimize all the windows is sufficient, isn't it?
SetTitleMatchMode 2
IfWinActive, AbstractSpoon
WinMinimize, AbstractSpoon
Else
WinMaximize, AbstractSpoon
return
The script minimizes only ToDoList and only if ToDoList's window is active but it maximizes ToDoList not matter where the user works at the moment (other app, desktop).
Thank you very much for you help in advance.
Cheers,
Jochen
|
|
|
|
|
|
Your speed is incredible !!!
Thank you very much. Works like a charm and makes life a lot easier.
Works btw not only for Comments, Task Tree and List View but also if an editing control had the focus before minimizing.
|
|
|
|
|
Hi Dan,
If I right-click in the comments field and choose 'Find' or 'Replace' I get "strange" highlighted letter combinations in the first field of the 'Find' resp. 'Replace' window.
For example:
Find: ?éš
Replace: ?§š
Cheers, Jochen
---
ToDoList 6.3.a7
OS: Win XP, SP3
P.S.
Sorry that I can't use the name of this first field in the Find or Replace window in English because it is shown in German although the header of the window is in English ???
|
|
|
|
|
I was going to blame it on the unicode port but i also get odd characters in my version of 6.2.
|
|
|
|
|
.dan.g. wrote: i also get odd characters in my version of 6.2.
True. I tested 6.2.8 too, but didn't mention it because you're heading with so much enthusiasm to 6.3 beta
|
|
|
|
|
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.
|
|
|
|
|