AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ComputerDiscipline - Advanced Window Blocking to help u work

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Kudos



Joined: 21 Aug 2006
Posts: 19

PostPosted: Thu Jul 03, 2008 4:34 am    Post subject: ComputerDiscipline - Advanced Window Blocking to help u work Reply with quote

ComputerDiscipline - Advanced Window Blocking to help get your work done!
----------------------------------------------------------------

The latest version can be found here:
http://www.autohotkey.net/~Kudos/ComputerDiscipline.zip


What is ComputerDiscipline?
----------------------------------------------------------------

This script helps you get your work done by only allowing you to use Windows/Applications that you specify. It should help to focus on your work and prevent yourself from getting distracted doing other stuff on the computer.

With ComputerDiscipline you can specify which Window Titles you want to allow or to block. Anything else you will not be allowed to use.

The blocked Applications/Windows can be set to be minimized to your system tray, or minimized or closed. You can also set titles for multi-tab applications which which will close a tab in the Window. For example 'Google Mail' in a web browser such as Firefox or IE.

There is also the ability to block certain websites/servers by switching windows ‘hosts’ files.


How to Use
----------------------------------------------------------------
1. Extract ComputerDiscipline.zip and run ComputerDiscipline.ahk
2. From 'profile' menu of script icon in System Tray, choose a profile to run.
3. Set the Window Titles and duration in the popup window, then click Block!
4. Now see if you can do your work without distractions!

Note: Until you are familiar with ComputerDiscipline, please save any work you have open before using it.


Further Info
----------------------------------------------------------------
It currently has two main Blocking modes – Block Mode and Allow Mode.

BlockApps Mode

This mode will block only the windows/applications that you specify. You could have block modes for things such as Games, Timewasting Websites, Work (i.e. for when work finishes).

AllowApps Mode

This mode will block all windows/applications except for those in the allow list. I have profiles for things such as Work, Review, etc. I can specify a duration and which profile I want and I should only be allowed to use those applications. Unallowed windows will currently be minimized to the system tray with the application icon (using Min2Tray).

Grace Feature – This is experimental but with AllowApps mode there is a slight delay before a window is blocked/minimized. If you hold shift or alt then you should be granted a period of grace for this window only. I have it set to grant a maximum of one 2minute grace period every 10mins.


Additional Features
----------------------------------------------------------------
Scheduler - Schedules can be set in the ini file in the format:
Sched#=hh,mm,DaysOfWeek,BlockMode,Profile,Hours,Mins

hh,mm is the start time. For DaysOfWeek, Sunday is 1, Monday is 2 etc. You give it the BlockMode and the name of the profile to enable. Hours,Mins is how long to block for.

Here is an example:
[Schedules]
NumSchedules=6
Sched1=8,00,23456,BlockApps,TimeWasters,1,0
Sched2=9,00,23456,BlockApps,Working,2,0
Sched3=12,00,23456,BlockApps,Working,1,0
Sched4=14,30,23456,BlockApps,Working,3,0
Sched5=18,00,23456,BlockApps,AtHome,2,0
Sched6=00,00,1234567,BlockApps,BedTime,4,0

AllowStop - This allows you to turn off ComputerDiscipline if you change your mind!

Lock Menus – When in Block Mode the menu items will be locked if you select this option.

Tooltips – If this option is turned on you should get some tooltips saying which windows are getting blocked/allowed and why.

Block Process Managers - Task Manager, Process Explorer, CurrProcess will all be killed when you are blocking apps.

Safe Window Classes/Titles - This setting in ini file is for windows which should never be blocked such as overlaying clocks, Winamp etc.

Credits and Thanks
----------------------------------------------------------------
Junyx / KTC^brain – For Min2Tray (ahk/exe)
Skrommel – For MinimOther.ahk where I took inspiration and borrowed code Wink
Anyone else I forgot – like whoever wrote the code to reload a script when a file is changed!


Last edited by Kudos on Wed Jul 09, 2008 1:01 am; edited 7 times in total
Back to top
View user's profile Send private message
ezuk



Joined: 04 Jun 2005
Posts: 122

PostPosted: Thu Jul 03, 2008 7:01 am    Post subject: Reply with quote

Nice! Seems interesting indeed!

Does it have a random-key password?
Back to top
View user's profile Send private message
Kudos



Joined: 21 Aug 2006
Posts: 19

PostPosted: Thu Jul 03, 2008 9:37 am    Post subject: Reply with quote

No Random key password.. Next on the list! Smile
Back to top
View user's profile Send private message
Kudos



Joined: 21 Aug 2006
Posts: 19

PostPosted: Fri Jul 04, 2008 2:00 am    Post subject: Reply with quote

I have just added Profile Scheduling to the ini file. I am now very pleased to have this feature! Smile

I have also cleaned up the code in general and made a couple of other fixes.


Last edited by Kudos on Wed Jul 09, 2008 12:53 am; edited 1 time in total
Back to top
View user's profile Send private message
JoeSchmoe



Joined: 17 Feb 2008
Posts: 50

PostPosted: Tue Jul 08, 2008 11:21 pm    Post subject: Reply with quote

Wow. I hate to admit this, but I've been dying for a program like this. Don't have the time to explore it right now, but I definitely will in the future!
Back to top
View user's profile Send private message
Sephiroth2906



Joined: 28 Apr 2007
Posts: 33

PostPosted: Fri Jul 18, 2008 9:13 pm    Post subject: Reply with quote

I am getting this error

---------------------------
ComputerDiscipline.ahk
---------------------------
Error: The following variable name contains an illegal character:
"CDC-INDX-D004"

The current thread will exit.

Line#
684: {
685: lastpopup := popup
686: if (ShowTooptips = 1)
687: ToolTip,%popup%
688: Sleep,3000
689: SetTimer,Close_ToolTip,3000
690: }
---> 692: if ((%a_computername%=JONPC) || (%a_computername%=JONLT))
693: {
694: FileMove,C:\Files\Toolbars\Home\*.tlbplugin,%A_ScriptDir%,1
695: Loop,C:\Files\Quick Launch\*.tlbplugin,0,1
696: FileMove,%A_LoopFileFullPath%,%A_ScriptDir%
697: }
698: Gosub,CloseProcMans
699: SetTitleMatchMode,%contain%

---------------------------
OK
---------------------------

Can this be fixed? Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group