TotalBalance
Joined: 22 Jan 2007 Posts: 180 Location: CO, USA
|
Posted: Mon Jul 28, 2008 10:59 am Post subject: Desktop GTD To Do List |
|
|
Background:
1) Was looking at some desktop scripts/apps to do stuff similiar to Google Desktop Gadgets (e.g. Samurize - www.samurize.com).
2) Came across this AHK thread about putting a To Do List on desktop.
3) Since my Affirmations script puts text on the desktop, decided to try my hand at customizing for Desktop GTD ToDo List script.
Enhancements I'd like to think on or get done:
* Double-Click GUI to open todolists.txt file in default text editor
* Figure out how to show clickable links that open programs or URLs
* Allow option to copy higlighted text to clipboard
* Integrate with Virtual Desktops POC script, by ahklerner, to open different "intelligent stickies" on different desktops.
Program Purpose:
* Pulls ToDoLists.txt file and displays on Desktop.
* Preferences allow user to move GUI (whether transparent or not), configure, text & background attributes, transparency/always on top options, time between each displayed affirmation, and text file selection.
Many thanks to the AutoHotkey forum users for all the code examples I learned from to hack this script together and in particular engunneer, and DerRaphael for helping me with the Preferences icon tray.
Installation & Use:
1. Extract & Install into folder of your choice (i.e. c:\...\my documents\ToDoLists\}. Both the source AHK and compiled EXE will be in parent folder.
2. Program icon and default ToDoLists.txt file are stored in {parent folder}\resources\ directory.
5. Modify default ToDoLists.txt as needed or choose another text file.
6. Right mouse click on System Tray Icon to change preferences.
7. Default setting show colored background with default text. Even when GUI is transparent, GUI can be moved with a left mouse click/drag within the region area. However, sometimes you have to move the mouse a few times for it to "catch". Therefore, defaults to help visualize where mouse needs to be to move GUI box.
8. To only show text, with transparent background, select "Yes" for Transparency option.
9. Play around with menu tray options and let me know what needs to be improved. Help and About files will be finished based on feedback.
10. Thanks!!
Screen Capture Example:
| Code: |
/*
Author: Lars Shirey (aka TotalBalance)
Alpha v.0.50 DT_TDL.ahk
*/
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#SingleInstance Force
#Persistent
SetBatchLines -1
DetectHiddenWindows, On
FileSelected = %A_Scriptdir%\Resources\ToDoLists.txt
; Create, read/write ini file
IfNotExist, %A_Scriptdir%\ToDoList.ini
{
IniWrite, Center, %A_Scriptdir%\ToDoList.ini, Settings, xPos
IniWrite, Center, %A_Scriptdir%\ToDoList.ini, Settings, yPos
IniWrite, Verdana, %A_Scriptdir%\ToDoList.ini, Settings, Font_Type
IniWrite, S16 Bold, %A_Scriptdir%\ToDoList.ini, Settings, Font_Style
IniWrite, Black, %A_Scriptdir%\ToDoList.ini, Settings, Font_Color
IniWrite, On, %A_Scriptdir%\ToDoList.ini, Settings, Transparent
IniWrite, Red, %A_Scriptdir%\ToDoList.ini, Settings, Background_Color
IniWrite, On, %A_Scriptdir%\ToDoList.ini, Settings, Always_On_Top
IniWrite, %FileSelected%, %A_Scriptdir%\ToDoList.ini, Settings, ToDoList_File
}
IfExist, %A_Scriptdir%\ToDoList.ini
{
IniRead, xPos, %A_Scriptdir%\ToDoList.ini, Settings, xPos
IniRead, yPos, %A_Scriptdir%\ToDoList.ini, Settings, yPos
IniRead, Font_Type, %A_Scriptdir%\ToDoList.ini, Settings, Font_Type
IniRead, Font_Style, %A_Scriptdir%\ToDoList.ini, Settings, Font_Style
IniRead, Font_Color, %A_Scriptdir%\ToDoList.ini, Settings, Font_Color
IniRead, Background_Color, %A_Scriptdir%\ToDoList.ini, Settings, Background_Color
IniRead, Transparent, %A_Scriptdir%\ToDoList.ini, Settings, Transparent
IniRead, Always_On_Top, %A_Scriptdir%\ToDoList.ini, Settings, Always_On_Top
IniRead, FileSelected, %A_Scriptdir%\ToDoList.ini, Settings, ToDoList_File
}
Aff_Full_Path = %FileSelected%
SplitPath, Aff_Full_Path, Aff_File_Name
Gosub, TrayMenu
; functions to adjust GUI based on user preferences
Menu, Transparent, Check, %Transparent%
Menu, Always_On_Top, Check, %Always_On_Top%
If Always_On_Top = On
AlwaysOnTop = +AlwaysOnTop
If Always_On_Top = Off
AlwaysOnTop =
; Handle upto Font size 20 - need to autosize GUI to fit text
GuiHeight = 320
GuiWidth = 240
;Gui display and transparency options
Gui, +LastFound
Gui, Color, %Background_Color%
Gui, Font, %Font_Style% C%Font_Color%, %Font_Type%
If Transparent = Off
{
Gui, +ToolWindow -Caption -Border %AlwaysOnTop%
Gui, Add, Text, w%GuiWidth% h%GuiHeight% GuiMove vToDoList
}
If Transparent = On
{
Gui, -Caption +ToolWindow %AlwaysOnTop%
Gui, Add, Text, w%GuiWidth% h%GuiHeight% BackgroundTrans GuiMove vToDoList
WinSet, TransColor, %Background_Color% 150
}
Gui, Show, x%xPos% y%yPos% NoActivate, ToDoList
GoSub, TDL_Read
Return
uiMove:
PostMessage, 0xA1, 2,,, A
; after moving GUI, save new positions to ini file
WinGetPos, xPos, yPos, Width, Height, ToDoList
IniWrite, %xPos%, %A_Scriptdir%\ToDoList.ini, Settings, xPos
IniWrite, %yPos%, %A_Scriptdir%\ToDoList.ini, Settings, yPos
Return
TDL_Read:
FileRead, TDL, %FileSelected%
GuiControl,, ToDoList, %TDL%
Return
; User Preferences Tray
TrayMenu:
Menu, Tray, Icon , %A_Scriptdir%\Resources\tick.ico, IconNumber, 1
Menu, Tray, Tip, ToDoList`n%Aff_File_Name%
Menu, Tray, MainWindow
Menu, Tray, NoStandard
Menu, Tray, Add, ToDoList, ToDoList
Menu, Tray, Add
Menu, Tray, Add, Select File, ToDoListFile
Menu, Tray, Add
Menu, Tray, Add, Font Selection, Font_Select
Menu, Colors, Add, TextColor
Menu, Colors, Add, BackgroundColor
Menu, Tray, Add, Choose Colors, :Colors
Menu, Transparent, Add, On
Menu, Transparent, Add, Off
Menu, Tray, Add, Transparent, :Transparent
Menu, Always_On_Top, Add, On
Menu, Always_On_Top, Add, Off
Menu, Tray, Add, Always on Top, :Always_On_Top
Menu, Tray, Add, Hide, Hide
Menu, Tray, Add, Show, Show
Menu, Tray, Add
Menu, Tray, Add, Help, Help
Menu, Tray, Add, About, About
Menu, Tray, Add
Menu, Tray, Add, Exit, Exit
Menu, Tray, Disable, Show
Menu, Tray, Default, ToDoList
Return
ToDoList:
Gui, Show, , ToDoList
Return
;Allow user to pick ToDoList text file from Windows Explorer
ToDoListFile:
Gui +OwnDialogs
FileSelectedBak := FileSelected
FileSelectFile, FileSelected
If ErrorLevel
FileSelected := FileSelectedBak
IniWrite, %FileSelected%, %A_Scriptdir%\ToDoList.ini, Settings, ToDoList_File
GoSub, Menu_Change
Return
; Font Preferences
Font_Select:
if !CmnDlg_ChooseFont(Font_Type, Font_Style, Font_Color)
return
IniWrite, %Font_Type%, %A_Scriptdir%\ToDoList.ini, Settings, Font_Type
IniWrite, %Font_Style%, %A_Scriptdir%\ToDoList.ini, Settings, Font_Style
IniWrite, %Font_Color%, %A_Scriptdir%\ToDoList.ini, Settings, Font_Color
Gosub, Menu_Change
Return
; Color Preferences, update ini file
TextColor:
if !CmnDlg_ChooseColor(Font_Color)
return
IniWrite, %Font_Color%, %A_Scriptdir%\ToDoList.ini, Settings, Font_Color
Gosub, Menu_Change
Return
BackgroundColor:
if !CmnDlg_ChooseColor(Background_Color)
return
IniWrite, %Background_Color%, %A_Scriptdir%\ToDoList.ini, Settings, Background_Color
Gosub, Menu_Change
Return
;Misc. Preference settings
On:
If A_ThisMenu = Transparent
IniWrite, On, %A_Scriptdir%\ToDoList.ini, Settings, Transparent
If A_ThisMenu = Always_On_Top
IniWrite, On, %A_Scriptdir%\ToDoList.ini, Settings, Always_On_Top
Gosub, Menu_Change
Return
Off:
If A_ThisMenu = Transparent
IniWrite, Off, %A_Scriptdir%\ToDoList.ini, Settings, Transparent
If A_ThisMenu = Always_On_Top
IniWrite, Off, %A_Scriptdir%\ToDoList.ini, Settings, Always_On_Top
Gosub, Menu_Change
Return
Show:
Gui, Show, , ToDoList
Menu, Tray, ToggleEnable, Show
Menu, Tray, ToggleEnable, Hide
Return
Hide:
Gui, Submit, ToDoList
Menu, Tray, ToggleEnable, Hide
Menu, Tray, ToggleEnable, Show
Return
; On any icon tray preferences change, reload script to reflect changes.
Menu_Change:
Reload
Return
; Just holding places for Help & About screens
Help:
MsgBox, 64, ToDoList - Help, To Be Completed Later`n
Return
About:
MsgBox, 64, ToDoList - About, To Be Completed Later`n
Return
; on exit, make sure everything is saved to ini file
Exit:
GuiEscape:
GuiClose:
IniWrite, %FileSelected%, %A_Scriptdir%\ToDoList.ini, Settings, ToDoList_File
IniWrite, %Font_Type%, %A_Scriptdir%\ToDoList.ini, Settings, Font_Type
IniWrite, %Font_Style%, %A_Scriptdir%\ToDoList.ini, Settings, Font_Style
IniWrite, %Font_Color%, %A_Scriptdir%\ToDoList.ini, Settings, Font_Color
IniWrite, %Background_Color%, %A_Scriptdir%\ToDoList.ini, Settings, Background_Color
IniWrite, %Transparent%, %A_Scriptdir%\ToDoList.ini, Settings, Transparent
IniWrite, %Always_On_Top%, %A_Scriptdir%\ToDoList.ini, Settings, Always_On_Top
IniWrite, %FileSelected%, %A_Scriptdir%\ToDoList.ini, Settings, ToDoList_File
WinGetPos, xPos, yPos, Width, Height, ToDoList
IniWrite, %xPos%, %A_Scriptdir%\ToDoList.ini, Settings, xPos
IniWrite, %yPos%, %A_Scriptdir%\ToDoList.ini, Settings, yPos
ExitApp
|
Download:
DT_TDL.ahk v0.50 Alpha
http://www.autohotkey.net/~TotalBalance/Productivity%20Scripts/DeskTopToDo.zip _________________ Lars
Last edited by TotalBalance on Sun Oct 26, 2008 6:52 pm; edited 2 times in total |
|