Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Autohotkey Script
; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a
; semicolon, such as this one, are comments. They are not executed.
; This script has a special filename and path because it is automatically
; launched when you run the program directly. Also, any text file whose
; name ends in .ahk is associated with the program, which means that it
; can be launched simply by double-clicking it. You can have as many .ahk
; files as you want, located in any folder. You can also run more than
; one ahk file simultaneously and each will get its own tray icon.
; SAMPLE HOTKEYS: Below are two sample hotkeys. The first is Win+Z and it
; launches a web site in the default browser. The second is Control+Alt+N
; and it launches a new Notepad window (or activates an existing one). To
; try out these hotkeys, run AutoHotkey again, which will load this file.
; GEBERECEKSIN JABBER
#IfWinActive, ahk_class wcl_manager1
esc::
{
IfWinActive, Cisco Jabber
{
WinMinimize
} else {
WinClose
}
Return
}
#IfWinActive, ahk_class Photo_Lightweight_Viewer
esc::
{
WinClose
}
#IfWinActive, ahk_class ENMainFrame
^!h::
{
Send,{Home}+{End}
Send, ^b
Sleep, 75
Send, ^-
Sleep, 75
Send, ^-
Sleep, 75
Send, {down}
Return
}
^h::
{
Send,{Home}+{End}
Send, ^b
Sleep, 75
Send, ^=
Sleep, 75
Send, ^=
Sleep, 75
Send, {down}
Return
}
^!c::
{
Send, ^d
Sleep, 300
Send, Courier New
Send, {ENTER}
Return
}
^!j::
{
IfWinExist, Cisco Jabber
WinActivate
Return
}
; Note: From now on whenever you run AutoHotkey directly, this script
; will be loaded. So feel free to customize it to suit your needs.
; Please read the QUICK-START TUTORIAL near the top of the help file.
; It explains how to perform common automation tasks such as sending
; keystrokes and mouse clicks. It also explains more about hotkeys.
; Start internet explorer when I copy a webex url in the clipboard
#IfWinActive, ahk_class rctrl_renwnd32
;WINDOWS-W brings up Internet Explorer with the clipped URL
$#w::
{
Tip("Starting webex")
clip := Clipboard
Run iexplore.exe "%clip%"
Return
}
;} http://www.autohotkey.com/board/topic/79494-go-to-anything-browseexploregoogle-the-selected-text/
#Persistent
; update mouse tooltip position this often, in ms
; 10 ms looks the smoothest, but you may prefer a higher value
; if the CPU load is too high with 10 ms
MouseTipUpdateInterval := 20
; a usage example
Tip("This is an example mousetip.")
;; Summon a mouse pointer anchored tooltip.
;; tip: message to show in tooltip
;; duration: how long the tooltip should persist; omit to let Tip() decide based on length of message
Tip(tip, duration = 0)
{
global Tooltip
; Show our tip immediately
Tooltip := tip
TurnMouseTipOn()
ForceMouseTipUpdate()
; Set the duration of the tip automatically unless specified
if (duration == 0)
duration := 100 * StrLen(Tooltip)
; Hide tip after duration
SetTimer, HideMouseTip, %duration%
}
TurnMouseTipOn()
{
global MouseTipUpdateInterval
; turn mouse tip on
SetTimer, ShowMouseTip, %MouseTipUpdateInterval%
; let the timer tick, so the tip gets updated
; right after being turned on; a successive
; Send could block the timer otherwise
Sleep % MouseTipUpdateInterval * 2
}
TurnMouseTipOff()
{
SetTimer, ShowMouseTip, Off
SetTimer, HideMouseTip, Off
ToolTip,
}
ForceMouseTipUpdate()
{
ForceMouseTipUpdateDelayed()
SetTimer, ShowMouseTip, 1 ; "undelayed"
}
ForceMouseTipUpdateDelayed()
{
global LastMouseTipX, LastMouseTipY
; this forces the mouse tip to get updated next timer tick
LastMouseTipX := LastMouseTipY := 0
}
ShowMouseTip:
SetTimer, ShowMouseTip, %MouseTipUpdateInterval%
CoordMode Mouse, Relative
MouseGetPos, xpos, ypos
if (LastMouseTipMsg != Tooltip || LastMouseTipX != xpos || LastMouseTipY != ypos)
{
LastMouseTipMsg := Tooltip
LastMouseTipX := xpos
LastMouseTipY := ypos
tip := Tooltip
ToolTip, %tip%, xpos + 25, ypos + 10
}
return
HideMouseTip:
TurnMouseTipOff()
Tooltip := ""
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment