Autohotkey

Autohotkey es una de esas herramientas que no puede faltar en ningún ordenador. Permite hacer macros utilizar hotkeys y programar comandos usando el ratón y pulsaciones de teclas. Junto a Texter y PowerMenu son las 3 herramientas que siempre deben estar en cualquier Windows.

A continuación os dejo mi script de Autohotkey. Lo que hace cada combinación o script viene comentado antes o después del mismo, así que no necesitaréis mucha más aclaración.

XButton1 & XButton2::WinMaximize, A    ; Maximize active window by Win+UpArrow.
#Up::WinRestore, A   ; Restore active window by Win+DownArrow.
#Down::WinRestore, A   ; Restore active window by Win+DownArrow.
#Left::WinMinimize, A  ; Minimize active window by Win+LeftArrow.
; ^ctrl
; !alt
; # windows
;
~LButton & WheelUp::Send {Volume_Up 5}
~LButton & WheelDown::Send {Volume_Down 5}
~RButton & WheelUp::
IfWinNotExist ahk_class Winamp v1.x
    return
; Otherwise, the above has set the «last found» window for use below.
ControlSend, ahk_parent, z
return
~RButton & WheelDown::
IfWinNotExist ahk_class Winamp v1.x
    return
; Otherwise, the above has set the «last found» window for use below.
ControlSend, ahk_parent, b
return
^!t:: Run C:\Program Files (x86)\TTCalc\ttcalc.exe
^!w:: Run C:\Program Files (x86)\Winamp\winamp.exe
^!c:: Run cmd.exe
^!s:: Run C:\Users\usuario\AppData\Roaming\Spotify\spotify.exe
^#!w:: Run C:\Users\usuario\Desktop\winscp
^#!s:: Run «C:\Users\usuario\AppData\Local\VanDyke Software\SecureCRT\SecureCRT.exe»
^#!t:: Run mstsc
^#!p:: Run c:\programs\TeclaPrintScreen.exe
!c::send {AppsKey}nc
ç:: ;
Ç:: ;
; SILENCIAR
break::
Send {Volume_Mute}
return
; CAPTURAR EL RGB del color
^+c::
MouseGetPos,x,y
PixelGetColor,rgb,x,y,RGB
StringTrimLeft,rgb,rgb,2
Clipboard=%rgb%
Return
;; Win+NumpadSub decrease sound volume, Win+NumpadAd increase sound volume
$#NumpadAdd::Send {Volume_Up 5} ; increase volume
$#NumpadSub::Send {Volume_Down 5} ; decrease sound level
; OCULTAR FICHEROS PROTEGIDOS
showHidden=0
#H::
WinGetActiveTitle, WinTitle
WinGetClass, WinClass, %WinTitle%
If WinClass <> CabinetWClass
If WinClass <> ExploreWClass
Return
Send, !T
Sleep, 100
Send, o
WinWaitActive, Folder Options,,5
if ErrorLevel = 1
Return
Send, ^{Tab}
Sleep, 50
Send, {Tab}{Tab}
Sleep, 50
If showHidden  = 0
{
showHidden = 1
Send, {Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}
}
Else
{
showHidden = 0
Send, {Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}
}
sleep, 50
Send, {Space}
Send, {Tab}{Tab}{Enter}
Return
;SPOTIFY
SetTitleMatchMode 2
; «CTRL + LEFT»  for previous
^Left::
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{Left}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
return
; «CTRL + RIGHT»  for next
^Right::
{
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{Right}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
return
}
; «CTRL + UP»  for pause
^UP::
{
DetectHiddenWindows, On
ControlSend, ahk_parent, {space}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
return
}
; «CTRL + DOWN»  for info
^Down::
{
DetectHiddenWindows, On
SetTitleMatchMode 2
WinGetTitle, now_playing, ahk_class SpotifyMainWindow
StringTrimLeft, playing, now_playing, 10
DetectHiddenWindows, Off
clipboard = %playing%`r`n
return
}
; «CTRL + PAGE UP»  for volume up
^PgUP::
{
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{Up}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
return
}
; «CTRL + PAGE DOWN»  for volume down
^PgDn::
{
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{Down}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
return
}
; «CTRL + END»  for mute
;^End::
;{
;DetectHiddenWindows, On
;ControlSend, ahk_parent, ^+{Down}, ahk_class SpotifyMainWindow
;DetectHiddenWindows, Off
;return
;}
; CARPETA NUEVA
#n::
Send, {AppsKey}NC
Return
#u::   ;; delete this to make this script run once and stop (for keyboard launchers)
IfWinExist, ahk_class MozillaUIWindowClass                      ;; modify ahk_class for use with other browsers
                WinActivate
                Send ^l
                Send ^c                 ;; put URL in clipboard
                Send ^t
                Send http://bit.ly/?url=
                Send ^v
                Send {Enter}
                Sleep 1500
                Send  ^a
                Sleep 100
                send ^c
                Sleep 100                     ;; change this for your pc
                ;send ^w
                msgbox %clipboard%`n`nShortened URL Copied to clipboard
                return
;; ALEX para pasar pagina mientras estamos metiendo revistas en Amsgle
#c::
IfWinExist, ahk_class MozillaUIWindowClass
Send !{Tab}
        Sleep 500
Send {PgDn}
        Sleep 300
Send !{Tab}
Send +{Tab 3}
Send {Enter}
Send {Tab 3}
;ALEX PARA BAJAR EL VOLUMEN DE WINAMP PULSANDO EL BOTON CENTRAL
;
;#NoEnv
;#Persistent
;SendMode Input
;MButton::
;  SendMessage, 0x400, Mod(27, 256), 122, ,ahk_class Winamp v1.x
;
;  Send, {MButton down}
;
;  Loop
;  {
;    Sleep, 10
;    GetKeyState, keyState, MButton, P
;
;    if keyState = U
;     break
; }
;  Send, {MButton up}
;  SendMessage, 0x400, Mod(128, 256), 122, ,ahk_class Winamp v1.x
;  return
;^!n::
;IfWinExist Untitled – Notepad
; WinActivate
;else
; Run Notepad
;return
; This next example asks Winamp which track number is currently active:
; #w::
; if ErrorLevel <> FAIL
; {
;     SendMessage, 1024, 0, 120, ahk_class Winamp v1.x
;     ErrorLevel += 1  ; Winamp’s count starts at 0, so adjust by 1.
;     MsgBox, Track #%ErrorLevel% is active or playing.
; }
; ALEX BAJAR SONIDO WINAMP CON ^m ( http://www.autohotkey.com/forum/topic28796.html )
<^>!m::
DetectHiddenWindows, On   ; Tells AHK to search for windows that are minimized/hidden
Target := «ahk_class Winamp v1.x»
IfWinNotExist %Target%
{ ; Try to open Winamp if it’s not open
   Run «%ProgramFiles%\Winamp\Winamp.exe»
   ;   WinWait ahk_parent   ; This caused problems??
   ;Return
   WinWait, %Target%
}
IfWinNotExist %Target%
{ ; Check to make sure we were able to open Winamp
   MsgBox Unable to open Winamp
   Return
}
; Winamp is now the last found window – funtions can now implicitly refer to it
; Gets current play status (0=Stopped, 1=Playing, 3=Paused)
SendMessage, 1024, 0, 104   ; IsWinampPlaying?
WinampPlayStatus := ErrorLevel
If( WinampPlayStatus == 0 )
{ ; Winamp playback in in a ‘Stopped’ state
   ControlSend, ahk_parent, x  ; Play
}
else
{
   ControlSend, ahk_parent, c  ; Pause/Unpause
}
return
;   —- —-

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *