Post Reply 
AutoHotKey
Dec. 15, 2008, 03:14 AM
Post: #1
AutoHotKey
It's basically a program where you can create new hotkey combinations!

I guess we can share our configs here Wink

Code:
; # = windows
; + = shift
; ! = alt
; ^ = control

#Include COM.ahk
#Include ws4ahk.ahk
#Include VA.ahk

#t::Run Thunderbird
#z::Run C:\Program Files\RocketDock\Rocketdock.exe
#n::Run Notepad++
#f::Run Firefox
#o::Run Opera
#g::Run C:\Users\Andrew\AppData\Local\Chromium\Application\Chrome.exe
#r::Run cmd
^!Tab::Run, taskmgr
#i::Run itunes
#d::WinMinimizeAll
;#d::Run c:\Program Files\Emerge Desktop\emerge.exe showdesktop
;^+d::Run C:\Users\Andrew\Desktop\
#e::Run C:\Program Files\zabkat\xplorer2\xplorer2_UC.exe
#c::Run C:\Program Files\CCleaner\ccleaner.exe /auto

; minimize all windows, pause iTunes, mute volume when locking computer
#l::
    WinMinimizeAll
    COM_Init()
    VA_SetMasterMute(true)
    ;Run c:\Program Files\Emerge Desktop\emerge.exe showdesktop
    Run,%A_WinDir%\System32\Rundll32.exe User32.dll,LockWorkStation
    WS_Initialize("JScript")
    Pause =
    (
        iTunesApp = new ActiveXObject("iTunes.Application");
        iTunesApp.Pause();
    )
    WS_Exec(Pause)  
    WS_Uninitialize()

;    WinWait, A
;
;    VA_SetMasterMute(false)
; resume iTunes, unmute when locking computer
;   WS_Initialize("JScript")
;   Resume =
;      (
;         iTunesApp = new ActiveXObject("iTunes.Application");
;         iTunesApp.Play();
;      )
;   WS_Exec(Resume)  
;   WS_Uninitialize()
return

; Win + 1 and 3 removes transparency of active window/taskbar
; Win + 2 and 4 sets transparency of active window/taskbar to 15%
#1:: WinSet, Transparent, 255, A
#2:: WinSet, Transparent, 217, A
#3:: WinSet, Transparent, 255, ahk_class Shell_TrayWnd
#4:: WinSet, Transparent, 217, ahk_class Shell_TrayWnd

;####### iTunes #######
; ALT + / to go play/pause
!/::
   DetectHiddenWindows,On
   ControlSend, ahk_parent, {space}, iTunes ahk_class iTunes
return

; ALT + < to go to previous song
!,::
   DetectHiddenWindows,On
   ControlSend, ahk_parent, ^{left}, iTunes ahk_class iTunes
return

; ALT + > to go to next song
!.::
   DetectHiddenWindows,On
   ControlSend, ahk_parent, ^{right}, iTunes ahk_class iTunes
return

;####### Other #######
; Auto-Reload AutoHotKey when this file is saved
~^s::
IfWinActive, %A_ScriptName%
{
   Send, ^s
   SplashTextOn,,,Updated script,
   Sleep,200
   SplashTextOff
   Reload
}
else
   Send, ^s
return
Visit this user's website
Add Thank You Quote this message in a reply
Dec. 15, 2008, 03:33 AM
Post: #2
RE: AutoHotKey
This is my code to operate the windows. ;-)
Code:
#NoEnv

; Retrieves the bounding coordinates of monitor WorkArea
SysGet, MonitorWorkArea, MonitorWorkArea
WorkAreaWidth := MonitorWorkAreaRight - MonitorWorkAreaLeft
WorkAreaHeight := MonitorWorkAreaBottom - MonitorWorkAreaTop

; Move Window Left
#Numpad4::
#NumpadLeft::
WinMove, A,,MonitorWorkAreaLeft,MonitorWorkAreaTop,WorkAreaWidth/2,WorkAreaHeight
return

; Move Window Top
#Numpad8::
#NumpadUp::
WinMove, A,,MonitorWorkAreaLeft,MonitorWorkAreaTop,WorkAreaWidth,WorkAreaHeight/2
return

; Move Window Right
#Numpad6::
#NumpadRight::
WinMove, A,,MonitorWorkAreaLeft+WorkAreaWidth/2,MonitorWorkAreaTop,WorkAreaWidth/2,WorkAreaHeight
return

; Move Window Bottom
#Numpad2::
#NumpadDown::
WinMove, A,,MonitorWorkAreaLeft,MonitorWorkAreaTop+WorkAreaHeight/2,WorkAreaWidth,WorkAreaHeight/2
return

; Move Window TopLeft
#Numpad7::
#NumpadHome::
WinMove, A,,MonitorWorkAreaLeft,MonitorWorkAreaTop,WorkAreaWidth/2,WorkAreaHeight/2
return

; Move Window TopRight
#Numpad9::
#NumpadPgUp::
WinMove, A,,MonitorWorkAreaLeft+WorkAreaWidth/2,MonitorWorkAreaTop,WorkAreaWidth/2,WorkAreaHeight/2
return

; Move Window BottomLeft
#Numpad1::
#NumpadEnd::
WinMove, A,,MonitorWorkAreaLeft,MonitorWorkAreaTop+WorkAreaHeight/2,WorkAreaWidth/2,WorkAreaHeight/2
return

; Move Window BottomRight
#Numpad3::
#NumpadPgDn::
WinMove, A,,MonitorWorkAreaLeft+WorkAreaWidth/2,MonitorWorkAreaTop+WorkAreaHeight/2,WorkAreaWidth/2,WorkAreaHeight/2
return

; Title Horizontal, Active Window at Left
#Left::
WinGetActiveTitle, Title
WinMinimize, %Title%
WinGetActiveTitle, LastTitle
WinMove, %LastTitle%,,MonitorWorkAreaLeft+WorkAreaWidth/2,MonitorWorkAreaTop,WorkAreaWidth/2,WorkAreaHeight
WinActivate, %Title%
WinMove, %Title%,,MonitorWorkAreaLeft,MonitorWorkAreaTop,WorkAreaWidth/2,WorkAreaHeight
return

; Title Horizontal, Active Window at Right
#Right::
WinGetActiveTitle, Title
WinMinimize, %Title%
WinGetActiveTitle, LastTitle
WinMove, %LastTitle%,,MonitorWorkAreaLeft,MonitorWorkAreaTop,WorkAreaWidth/2,WorkAreaHeight
WinActivate, %Title%
WinMove, %Title%,,MonitorWorkAreaLeft+WorkAreaWidth/2,MonitorWorkAreaTop,WorkAreaWidth/2,WorkAreaHeight
return

; Title vertical, Active Window at Top
#Up::
WinGetActiveTitle, Title
WinMinimize, %Title%
WinGetActiveTitle, LastTitle
WinMove, %LastTitle%,,MonitorWorkAreaLeft,MonitorWorkAreaTop+WorkAreaHeight/2,WorkAreaWidth,WorkAreaHeight/2
WinActivate, %Title%
WinMove, %Title%,,MonitorWorkAreaLeft,MonitorWorkAreaTop,WorkAreaWidth,WorkAreaHeight/2
return

; Title vertical, Active Window at Bottom
#Down::
WinGetActiveTitle, Title
WinMinimize, %Title%
WinGetActiveTitle, LastTitle
WinMove, %LastTitle%,,MonitorWorkAreaLeft,MonitorWorkAreaTop,WorkAreaWidth,WorkAreaHeight/2
WinActivate, %Title%
WinMove, %Title%,,MonitorWorkAreaLeft,MonitorWorkAreaTop+WorkAreaHeight/2,WorkAreaWidth,WorkAreaHeight/2
return

; Maximize Window
#Numpad5::
#NumpadClear::
WinRestore, A            ; without this, WinMaximize will not work
WinMaximize, A
return

; Minimize Window
#PgDn::
WinGetActiveTitle, Title
WinMinimize, %Title%
return

; Restore Window
#PgUp::
; WinRestore, %Title%
; WinRestore Can't Resotore Window From System Tray, Use WinShow and WinActivate Instead
WinShow, %Title%
WinActivate, %Title%
return

; Toggle AlwaysOnTop
#Numpad0::
#NumpadIns::
WinSet, AlwaysOnTop, Toggle, A
return

; Toggle Window Title Bar Display
#NumpadEnter::
WinSet, Style, ^0xC00000, A  ; Toggle the active window's title bar (WS_CAPTION).
Return

; Toggle Taskbar Hide/Show
#NumpadDot::
#NumpadDel::
If (TaskbarHide := !TaskbarHide)
    WinHide ahk_class Shell_TrayWnd
Else
    WinShow ahk_class Shell_TrayWnd
return
Add Thank You Quote this message in a reply
Dec. 15, 2008, 02:09 PM
Post: #3
RE: AutoHotKey
i'm quite new to AutoHotKey (someone here actually pointed it out to me, don't recall offhand, but "thanks" to whomever, lol)...

i've been trying to get mine to "auto-close" the 'failed to clear DNS cache' dialog when i "repair" my 'net connection...

due to a "large" HOSTS file, i have the (stupid) DNS Client service disabled, so a "repair" will ALWAYS "fail" to clear the DNS cache...

why MS isn't "smart enough" NOT to 'attempt' to clear a cache that is DISABLED is beyond me, but i digress...
Add Thank You Quote this message in a reply
Dec. 15, 2008, 02:37 PM
Post: #4
RE: AutoHotKey
Mmm, i want to put my hands on this wonderful program Big Teeth In fact, i'm behind a small project similar to the "nocturnal" from Kye-U, my plan is to put a black background, and set the transparency of the browser, to respect their original colors but all of them darker. If i get it, i will post it here. If someone can make it, would be very welcome Wink

For creating macros by now i use to Macro Express, not freeware Sad

For running programs only and not using macros, it's possible to be done just with the start menu from windows, right click on the direct access, properties and choose your combination of keys.

Executor (like launchy), i press ALT+SPACE and write a few letters to execute one of the programs from my start menu or folders choosen

Gridmove, to move and resize each window to the area you want. We can create our own grid easily. I made one with 3 blocks, one block on left with 1024 of width, and two at right border being the one on top bigger. This software work for dual monitors too. One disadvange, not very sure, but i think it can slow down my pc because of the hooks...

Window space, to snap the movemente/resizement of windows

For testing different but similar program, i recomend as always Sandboxie. I knew this program only one month ago, and now i would feel naked without it. Its like a firewall but for writings in the hard disk

Thanks for sharing Wink
Add Thank You Quote this message in a reply
Jan. 09, 2009, 02:17 AM
Post: #5
RE: AutoHotKey
I wrote a very simple script that will translate selected text:

Code:
; translate selected text
#u::
    Send ^c
    ClipWait
    Run http://translate.google.com/translate_t#auto|en|%clipboard%
return

Google has the ability to automatically detect the language of the string; feel free to modify it so it translates the string into a language of your choice. (e.g.: Run http://translate.google.com/translate_t#...clipboard%)

#u = WIN + U.

EDIT: Similarly:

Code:
; search selected text
#g::
    Send ^c
    ClipWait
    ;Transform, Clipboard, Unicode
    Run http://www.google.com/search?q=%Clipboard%
return
Visit this user's website
Add Thank You Quote this message in a reply
Jan. 13, 2009, 12:03 PM
Post: #6
RE: AutoHotKey
I use to update my filters everyday and i never remember the day we live. So i read the help of autohotkey, and here is my first script Wink

The format used is the ISO 8601 Calendar date format with two digits for year ==> 090113 Just push CTRL+ALT+d (d from date for easy remembering)
Code:
^!d::
FormatTime, Today, %A_NowUTC%, yyMMdd
Send %Today%
return
Add Thank You Quote this message in a reply
Jan. 13, 2009, 08:50 PM
Post: #7
RE: AutoHotKey
Wow, works very well! This will come in handy when I need to datestamp my filters Wink
Thanks.
Visit this user's website
Add Thank You Quote this message in a reply
Jan. 13, 2009, 09:23 PM
Post: #8
RE: AutoHotKey
A pleasure to help you Kye-U Wink
Add Thank You Quote this message in a reply
Jan. 18, 2009, 07:12 AM
Post: #9
RE: AutoHotKey
I am still using Winkey. It allows setting of keyboard shortcuts using the Windows key. I have it set to launch a few select processes which require special handling or need command line arguments.
Add Thank You Quote this message in a reply
Jan. 18, 2009, 01:19 PM
Post: #10
RE: AutoHotKey
i suspect you'll like HotKeyz (also free) better then WinKey - http://www.skynergy.com/hotkeyz.html
Add Thank You Quote this message in a reply
Jan. 19, 2009, 05:25 AM
Post: #11
RE: AutoHotKey
Thanks for the suggestion, but I have found Winkey to be all that I need so far.
Add Thank You Quote this message in a reply
Jan. 19, 2009, 12:13 PM
Post: #12
RE: AutoHotKey
no prob, i only suggest it 'cause i used to use WinKey, but since it can ONLY use the Windows Key, that "limitation" had me replace it with HotKeyz...
Add Thank You Quote this message in a reply
Feb. 17, 2009, 01:34 AM
Post: #13
RE: AutoHotKey
(Dec. 15, 2008 02:37 PM)lnminente Wrote:  Mmm, i want to put my hands on this wonderful program Big Teeth In fact, i'm behind a small project similar to the "nocturnal" from Kye-U, my plan is to put a black background, and set the transparency of the browser, to respect their original colors but all of them darker. If i get it, i will post it here. If someone can make it, would be very welcome Wink

The result i wanted was already done, and better!! Smile!)))) (Useful for non laptop computers)
http://www.donationcoder.com/Software/Sk...Screen.ahk

Take a look here for more very interesting scripts here. I didn't examine the full page yet, but I also like a lot: BatteryRun, DetachVideo, MoveOut, OpeningHours, HideDesktop, Transother, DelEmpty ...
Add Thank You Quote this message in a reply
Mar. 23, 2009, 11:30 PM
Post: #14
RE: AutoHotKey
I generally recommend AutoIT + SCITE if you really want powerful free scripting/programming language that is also quite simple. AutoIT started as a hotkey language, and has grown up quite a bit. It's very useful in enterprise sorts of situations, I use it in most all software deployment at work.

The only thing better might be python as it's cross platform, but hey...
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: