Good evening to all, from a relative newcomer.
I would like to make users of AHK aware of a program called ToDoList
http://www.codeproject.com/tools/ToDoList2.asp
A extremely handy way to organise your AHK scripts
I am not connected in anyway, but find this a absolute hidden gem.
This program was written by a programmer to keep a check list of his own Programming tasks.
Features
- Freeware
- Tree layout of tasks, hierarchical
- Multiple Task Lists
- Linking to files
- Searching of List
- Filters of List
- The most optioned and customized Task List I have ever seen.
So how do I use ToDoList and AHK.
If I find a really useful piece of code I copy it to the comments section of ToDoList, and give the script a Title.
If it is a whole script I am saving, I save the script in Notepad++ .and also copy the script code to the comments section.
Then link the .ahk script via ToDoList 'File Reference'.
Now I can launch the AHK file directly from ToDoList from the view button.
Because ToDoList is in a tree format.
I have a Parent task called AHK snippets, this has several sub tasks titles such as, Menus, Loops, Hotkeys, GUI etc, these now have any snippets I have collected under the appropriate subtasks.
I have another Parent title called 'Handy Full Scripts' for all full scripts
and my own parent title for mostly useless, unfinished, confused, and partly working scripts
This keeps everything well organised.
I can also add a URL of any web page to the comments or File Ref field of any task. this allows you to launch the relevent web page from the task. Allowing you to return to the source of the reference information.
The task Lists allow sorting of columns, so I can sort by Date Created, Task Title, Priority, Last Modified, Category, Assigned to, Created by, Status. (There is 22 fields that can be turned On/Off via preferences.)
A little about those columns,
You can add a 'Category' to a task, eg. Work, Personnel, XP, Command Line, games, multimedia,
You can add a 'Status' to a task, eg Started, Planning, Testing, Released, Finished.
You can add a priority to a task, rate your ahk scripts, 1 - 10
You can assign a script in a team environment to someone else.
You can estimate how much of the task is complete, 70% AHK script complete.
Would you like to track how much time you spend coding a script, then turn on the clock, it will log how long you spend on that task.
How about the ability to search all of the information we have now created or collected in out tasklists. including comments.
ie, Find 'GuiControlGet' will return a list of all tasks with 'GuiControlGet' in the comments or title section.
Like the search in this forum,
So now here is the catch.
I found ToDoList via google one day and never looked for a Task organizer again.
But I liked to tinker with macro utilities to automate some of ToDoList shortcuts.
Eventually I found AHK, and wow, this application is also amazing. (thanks Chris, wd)
I have tried to write a script that will copy whatever I have highlighted straight into ToDoList via its command line.
I have had moderate success but unfortunately its not very well written. (see beginner)
I have got it to work and it is enough for me, but I believe it is worth sharing or developing further as it is a really useful combination.
@AGU and CopyPassage users. I encourage you to try this. I use it a lot to copy the URL and contents of the clipboard to ToDoList, its extremely organised and great for gathering reference material. You can relaunch the URL from ToDoList by holding down the control key to activate the link. The script below allows for the adding of Clipboard, URL of Page(IE/Firefox/Avant), Page title, Time and Date, Logged in Users name, Computer name. All to the Task Title or comments section.
I know that this code should be posted in the 'Ask for help' but
a) It only works with ToDoList
b) I don't know how to link.
so, if a moderator feels the need to split this correctly, please do.
Problems,
-code to be optimised (loops, etc)
-calling preferences from task bar first time comes up empty.
-could not get get a alternate hotkey to work
-probably obsolete lines
-it really is a mess, so a total rewrite may be needed.
-I don't have physical time to keep learning, but would like to.
To Use.
-Install ToDoList from the above link
-Move Copy2Task.ahk to the same directory as ToDoList
-Run Script
-Highlight text in web, email, pdf, word doc, help file, whatever.
-Press win+c , brings up intermediate GUI
-OK, will start ToDoList if closed and copy clipboard as per preferences.
Very useful, and a great idea. just poorly implemented be me.
Make sure you look into ToDoList preferences.
Code:
#Persistent
SplashTextOn,300 ,, Copy2Task default Hotkey is Win+c.
Sleep, 4000
SplashTextOff
;IniRead , Sethotkey ,Copy2Task.ini,ScriptHotkeys,1,#c ;this dosn't work.
Menu, Tray, NoStandard
Menu, Tray, Add, Open Preferences, Preferences
Menu, Tray, Add
Menu, Tray, Add, Exit, Exitcopy2task
Menu, Tray, Tip, Copy2task for TDL
;*** Hotkey Activate and Assign all variables
HotkeyActivate:
#c::
clipboard =
URL =
AllHighlightedText =
Dropdownfilelist =
AssignallClipboardVariable:
SetTitleMatchMode,2
FormatTime, TimeString ;%timestring% is the current time and date
WinGetTitle, WindowTitle, A ;returns the Window Title
sleep, 300
send, ^c
ClipWait, 2
if ErrorLevel <> 0
{
MsgBox, The attempt to copy text onto the clipboard failed.
return
}
;trim clipboard to different lengths
AllHighlightedText= %clipboard%
Stringleft ,30HLtext ,AllHighlightedText ,30 ;clip the string to 30 chars for TDL Title
StringReplace ,30HLtext ,30HLtext ,`r`n, _, All ;remove linefeeds in task title
Stringleft ,50HLtext ,AllHighlightedText ,50 ;
StringReplace ,50HLtext ,50HLtext ,`r`n, _, All ;
Stringleft ,70HLtext ,AllHighlightedText ,70 ;
StringReplace ,70HLtext ,70HLtext ,`r`n ,_, All ;
;check for Firefox
IfWinActive, Mozilla Firefox
{
Send, !d ;Alt D shortcut to Address Bar
sleep, 200
Send, ^c
sleep,300
URL = %clipboard%
sleep,100
}
;check for Avant
IfWinActive, Avant Browser
{
Send, !d ;Alt D shortcut to Address Bar
sleep, 200
Send, ^c
sleep,300
URL = %clipboard%
sleep,100
}
;Check for IE
IfWinActive, Microsoft Internet Explorer
{
Send, !d ;Alt D shortcut to Address Bar
sleep, 200
Send, ^c
sleep,300
URL = %clipboard%
sleep,100
}
;*
;*** Initial Read INI file
InitialReadINIFile:
Iniread, file1, Copy2Task.ini, copy2files, 1, No file set. ;copy2file r the TDl file locations
iniread, file2, Copy2Task.ini, copy2files, 2, No file set.
iniread, file3, Copy2Task.ini, copy2files, 3, No file set.
iniread, file4, Copy2Task.ini, copy2files, 4, No file set.
iniread, ddl1, Copy2Task.ini, DDL, 1, 6 ;what is selected in each DDL
iniread, ddl2, Copy2Task.ini, DDL, 2,
iniread, ddl3, Copy2Task.ini, DDL, 3,
iniread, ddl4, Copy2Task.ini, DDL, 4, 3
iniread, ddl5, Copy2Task.ini, DDL, 5, 1
iniread, ddl6, Copy2Task.ini, DDL, 6,
iniread, ddl7, Copy2Task.ini, DDL, 7,
iniread, ddl8, Copy2Task.ini, DDL, 8,
iniread, commentsini1, Copy2Task.ini, comments, 1, %A_Space% ;pre copied comments
iniread, commentsini2, Copy2Task.ini, comments, 2, %A_Space%
iniread, commentsini3, Copy2Task.ini, comments, 3, %A_Space%
iniread, commentsini4, Copy2Task.ini, comments, 4, %A_Space%
iniread, commentsini5, Copy2Task.ini, comments, 5, %A_Space%
StringReplace, commentsini1, commentsini1, ``n, `n, All ;flatten to single line
StringReplace, commentsini2, commentsini2, ``n, `n, All
StringReplace, commentsini3, commentsini3, ``n, `n, All
StringReplace, commentsini4, commentsini4, ``n, `n, All
StringReplace, commentsini5, commentsini5, ``n, `n, All
; IniRead , Sethotkey ,Copy2Task.ini,ScriptHotkeys,1,#c ;this dosn't work.
;*
;*** Loop8 times to Allocate A1 to A8 the correct variables from DDL
Loop8times:
loop,8 ;Loop8 times to Allocate A1 to A8 the correct variables from the DDL
{
if (DDL%a_index%=1)
a%a_index%:=AllHighlightedText ;All Highlighted Text
if (DDL%a_index%=2)
a%a_index%:=WindowTitle
if (DDL%a_index%=3)
a%a_index%:=URL
if (DDL%a_index%=4)
a%a_index%:=30HLtext
if (DDL%a_index%=5)
a%a_index%:=50HLtext
if (DDL%a_index%=6)
a%a_index%:=70HLtext
if (DDL%a_index%=7)
a%a_index%:=A_ComputerName ;A_ComputerName ; The network name of the computer. [requires 1.0.24+]
if (DDL%a_index%=8)
a%a_index%:=A_UserName ;A_UserName ; The logon name of the current user. [requires 1.0.24+]
if (DDL%a_index%=9)
a%a_index%:=timestring
}
;*
;*** Compile TDL variable into single stringText
CompileTDLtext:
tasktitle= %a1%, %a2%, %a3%
taskcomments=%commentsini1%%a4%`n%commentsini2%%a5%`n%commentsini3%%a6%`n%commentsini4%%a7%`n%commentsini5%%a8%
;*
;*** Build Copy GUI
DisplayCopyGUI:
Dropdownfilelist=%file1%||%file2%|%file3%|%file4%
GUI, add, text, x5 y5 ,The TDL task Title
GUI, add, edit, x5 y20 r3 w500 vtasktitle ,%tasktitle%
GUI, add, text, x5 y90 ,The TDL Task Comments
GUI, add, edit, x5 y105 r14 w500 vtaskcomments ,%taskcomments%
GUI, add, text, x5 y305 ,Select the ToDoList file to send to
GUI, add, dropdownlist, x5 y320 w500 vselectedfile ,%Dropdownfilelist%
GUI, font, s14,
;*
GUI, add, button, x10 y350 w30 gPreferences ,Preferences
GUI, add, button, x400 y350 w100 Default vOK gSendAllDetailstoTDL ,&OK
;*** Guicontrol of COPY gui and Show
RefreshCopyGUI:
Guicontrol , ,tasktitle ,%tasktitle%
Guicontrol , ,taskcomments ,%taskcomments%
Guicontrol , ,Dropdownfilelist ,%Dropdownfilelist%
GUI, show, , copy2task - Send the clipboard to ToDoList
GuiControl, Focus, OK ; Set keyboard focus to OK
return
;*
;*** Send all details to TDL
SendAllDetailstoTDL:
GUI,submit
GUI,destroy
SetTitleMatchMode,2
run, todolist.exe "%selectedfile%" -nt "%tasktitle%" -cm "%taskcomments%",,UseErrorLevel
if ErrorLevel = ERROR
MsgBox, ERROR _ Please make sure that the file 'TDLcopy2task.exe' is in`nsame directory as ToDoList.exe
winwaitactive, ToDoList © AbstractSpoon
return
;*
;*** Destroy Close CopyGUI
DestroyHideCopyGUI:
guiescape:
guiclose:
GUI,destroy
exit
;*
;*** Preferences
Preferences:
GUI,destroy
Droplistnames = All of the HL Text|The Window/Page Title|The URL in the Address bar|The 1st 30 Chars of HL Text|The 1st 50 chars of HL text|The 1st 70 chars of HL text|The Computers Name|The Users Name|The Current time-date | |
Gui,2: Add, Edit, r2 x5 y102 w250 vcomments1 , %commentsini1%
Gui,2: Add, Edit, r2 x5 y+17 w250 vcomments2 , %commentsini2%
Gui,2: Add, Edit, r2 x5 y+17 w250 vcomments3 , %commentsini3%
Gui,2: Add, Edit, r2 x5 y+17 w250 vcomments4 , %commentsini4%
Gui,2: Add, Edit, r2 x5 y+17 w250 vcomments5 , %commentsini5%
Gui,2: Add, Text, x5 y5 , This will be the layout of you TDL TITLE in the task list.
Gui,2: Add, Text, x5 y57 , Now choose the format that you would like the COMMENTS of TDL task to be.
Gui,2: Add, Text, x5 y82 , You can enter your own custom text in these edit boxes below.
Gui,2: Add, Text, x325 y82 , Select the Information to be generated from the dropdowns.
Gui,2: Add, Dropdownlist, x5 y20 w200 vDDL1 AltSubmit , %Droplistnames%
Gui,2: Add, Text, x+5 , ,
Gui,2: Add, Dropdownlist, x+5 w200 vDDL2 AltSubmit , %Droplistnames%
Gui,2: Add, Text, x+5 , ,
Gui,2: Add, Dropdownlist, x+5 w200 vDDL3 AltSubmit , %Droplistnames%
Gui,2: Add, Dropdownlist, x325 y102 w250 vDDL4 AltSubmit , %Droplistnames%
Gui,2: Add, Dropdownlist, x325 y+30 w250 vDDL5 AltSubmit , %Droplistnames%
Gui,2: Add, Dropdownlist, x325 y+30 w250 vDDL6 AltSubmit , %Droplistnames%
Gui,2: Add, Dropdownlist, x325 y+30 w250 vDDL7 AltSubmit , %Droplistnames%
Gui,2: Add, Dropdownlist, x325 y+30 w250 vDDL8 AltSubmit , %Droplistnames%
Gui,2: Add, Text, x5 y350 , Eg.`n---The Page title is--- The Window/Page Title `nTime and Date task was created==== The Current time-date.
Gui,2: Add, Text, x5 y420 , Select the Task list for the drop down list. Note: Must be a .tdl extension.
Gui,2: Add, Edit, x5 yp+20 w377 vEdtFile1 , %file1%
Gui,2: Add, Button, x395 yp w45 vBtnSet1 gBtnSet , Set 1
Gui,2: Add, Button, x445 yp w45 gBtnClr1 , Clear 1
Gui,2: Add, Text, x500 yp , File 1 is Default
Gui,2: Add, Edit, x5 yp+22 w377 vEdtFile2 , %file2%
Gui,2: Add, Button, x395 yp w45 vBtnSet2 gBtnSet , Set 2
Gui,2: Add, Button, x445 yp w45 gBtnClr2 , Clear 2
Gui,2: Add, Edit, x5 yp+22 w377 vEdtFile3 , %file3%
Gui,2: Add, Button, x395 yp w45 vBtnSet3 gBtnSet , Set 3
Gui,2: Add, Button, x445 yp w45 gBtnClr3 , Clear 3
Gui,2: Add, Edit, x5 yp+22 w377 vEdtFile4 , %file4%
Gui,2: Add, Button, x395 yp w45 vBtnSet4 gBtnSet , Set 4
Gui,2: Add, Button, x445 yp w45 gBtnClr4 , Clear 4
;Gui,2: Add, text, x20 yp+40 , Select a alternative hotkey to activate Copy2task (f12 default)
;Gui,2: Add, Hotkey, x20 yp+20 w60 vTDLHotkey , %Sethotkey% ;this dosn't work.
Gui,2: font,s14,
;*
Gui,2: Add, Button, x395 w200 default vSubmitprefs gSubmitPrefs ,&Save Preferences
;*** Set Prefs GUI via GUIcontrol
SetPrefsviaGUIcontrol:
Guicontrol,2: ,Edtfile1 , %file1%
GuiControl,2: ,Edtfile2 , %file2%
Guicontrol,2: ,Edtfile3 , %file3%
Guicontrol,2: ,Edtfile4 , %file4%
Guicontrol,2: choose ,DDL1 , %ddl1%
Guicontrol,2: choose ,DDL2 , %ddl2%
Guicontrol,2: choose ,DDL3 , %ddl3%
Guicontrol,2: choose ,DDL4 , %ddl4%
Guicontrol,2: choose ,DDL5 , %ddl5%
Guicontrol,2: choose ,DDL6 , %ddl6%
Guicontrol,2: choose ,DDL7 , %ddl7%
Guicontrol,2: choose ,DDL8 , %ddl8%
Guicontrol,2: ,comments1 , %commentsini1%
Guicontrol,2: ,comments2 , %commentsini2%
Guicontrol,2: ,comments3 , %commentsini3%
Guicontrol,2: ,comments4 , %commentsini4%
Guicontrol,2: ,comments5 , %commentsini5%
; Guicontrol,2: ,Sethotkey , %Sethotkey% ;this dosn't work.
;*
Gui,2: Show, , Copy2Task Preferences
GuiControl,2: Focus, SubmitPrefs ; Set keyboard focus to Submit Prefs Button
return
SetTitleMatchMode, 2
;*** button set file definitions in preferences,
BtnSet:
StringRight, ID, A_GuiControl, 1
SetFile(ID)
return
SetFile(ID)
{
FileSelectFile,NewFile,,,,*.tdl
If Newfile=
return
else
IniWrite,%NewFile%,Copy2Task.ini,copy2files,%ID%
GuiControl,, EdtFile%ID%, %NewFile%
}
BtnClr1:
IniWrite,No file set,Copy2Task.ini,copy2files,1
GuiControl,, EdtFile1, No File Set
gosub, Preferences
return
BtnClr2:
IniWrite,No file set,Copy2Task.ini,copy2files,2
GuiControl,, EdtFile2, No File Set
gosub, Preferences
return
BtnClr3:
IniWrite,No file set,Copy2Task.ini,copy2files,3
GuiControl,, EdtFile3, No File Set
gosub, Preferences
return
BtnClr4:
IniWrite,No file set,Copy2Task.ini,copy2files,4
GuiControl,, EdtFile4, No File Set
gosub, Preferences
return
;*
;*** Submit Preferences
SubmitPrefs:
Gui,2:Submit
;*
;*** Write to INI file
WriteINI:
IniWrite, %DDL1%, Copy2Task.ini, DDL,1
IniWrite, %DDL2%, Copy2Task.ini, DDL,2
IniWrite, %DDL3%, Copy2Task.ini, DDL,3
IniWrite, %DDL4%, Copy2Task.ini, DDL,4
IniWrite, %DDL5%, Copy2Task.ini, DDL,5
IniWrite, %DDL6%, Copy2Task.ini, DDL,6
IniWrite, %DDL7%, Copy2Task.ini, DDL,7
IniWrite, %DDL8%, Copy2Task.ini, DDL,8
StringReplace, comments1, comments1, `n, ``n, All
StringReplace, comments2, comments2, `n, ``n, All
StringReplace, comments3, comments3, `n, ``n, All
StringReplace, comments4, comments4, `n, ``n, All
StringReplace, comments5, comments5, `n, ``n, All
IniWrite ,%comments1% ,Copy2Task.ini,Comments,1
IniWrite ,%comments2% ,Copy2Task.ini,Comments,2
IniWrite ,%comments3% ,Copy2Task.ini,Comments,3
IniWrite ,%comments4% ,Copy2Task.ini,Comments,4
IniWrite ,%comments5% ,Copy2Task.ini,Comments,5
; IniWrite ,%TDLHotkey% ,Copy2Task.ini,ScriptHotkeys,1;
; IniRead , Sethotkey ,Copy2Task.ini,ScriptHotkeys,1,#c
; Hotkey ,%Sethotkey% ,HotkeyActivate ;this dosn't work.
;*
Gui,2: destroy
goto,Loop8times
;*** DestroyHidePrefsGUI
DestroyHIDEPrefsGUI: ;Destroy GUI Preferences
;msgbox, before 2guiclose
2GUIclose:
2guiescape:
;msgbox, before Gui destroy
Gui,2: destroy
Gui, destroy
;msgbox, after gui2escape
return
Exitcopy2task:
exitapp
;*