/AutoHotkey.ahk
https://bitbucket.org/micedir/config · AutoHotKey · 357 lines · 265 code · 41 blank · 51 comment · 16 complexity · e0c087dd21b50295d681a6c62f34eae9 MD5 · raw file
- ; AutoHotKey.ahk (c) micedir
- ; version 0.1.5.4
-
- ; 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.
- ; Note: From now on whenever you run AutoHotkey directly, this script
- ; will be loaded.
-
- #SingleInstance force
-
- silent_en()
- {
- PostMessage, 0x50, 0, 0x4090409,, A; switch keyboard to default english layout
- }
-
- ; Menu key minimize the active window
- AppsKey::
- silent_en()
- WinGetActiveTitle, Title
- WinGetClass, class, A
- if ( class = "QWidget" ) ; Title = "Clementine" or filename
- {
- WinGet, ProcessName, ProcessName, A
- ;MsgBox, The active window is "%Title%" Класс активного окна "%class%" ProcessName is "%ProcessName%"
- if ( ProcessName = "clementine.exe" )
- {
- WinMinimize,A
- ;WinClose, A
- }
- else
- Send ! {Down}{Down}{Down}{Enter}
- }
- else
- {
- Send ! {Down}{Down}{Down}{Enter}
- }
- return
-
- ^+AppsKey::
- WinGetActiveTitle, Title
- WinGetClass, class, A
- WinGet, ProcessName, ProcessName, A
- MsgBox, The active window is "%Title%" Класс активного окна "%class%" ProcessName is "%ProcessName%"
- return
-
- ; Alt-F9 свернуть активное окно
- !F9:: Send ! {Down}{Down}{Down}{Enter}
- ^F9:: Send ! {Down}{Down}{Down}{Enter}
- #F9:: Send #d+!{Tab}
- ; Win + up/down Window as in Windows7
- #Up:: WinMaximize A ; need dowbleClick on WindowTitle for cycle /WinRestore
- #Down:: Send ! {Down}{Down}{Down}{Enter}
- ^F10:: Send !{Tab}! {Down}{Down}{Down}{Enter}
- !F10:: WinMaximize A
- !+F10:: WinRestore A
-
-
-
- ; http://forum.script-coding.com/viewtopic.php?pid=63656
- switch_en()
- {
- ; переключение активного окна в английскую раскладку
- PostMessage, 0x50, 0, 0x4090409,, A
- SoundBeep, 5000, 30 ; для полного выключения звука закомментируйте
- }
-
- switch_ru()
- {
- ; переключение активного окна в русскую раскладку
- PostMessage, 0x50, 0, 0x4190419,, A
- SoundBeep, 200, 30 ; для полного выключения звука закомментируйте
- }
-
- ; переключаем активное окно в английскую раскладку по нажатию клавиши:
- RAlt:: switch_en()
-
- ; переключаем активное окно в русскую раскладку по нажатию клавиши:
- RWin:: switch_ru()
-
-
- ; Win+P Пуск -> Все программы
- #p:: Send ^{Esc}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Enter}
- ; Win+Ctrl+P Панель Управления
- #^p:: Send ^{Esc}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Enter}! {Down}{Down}{Down}{Enter}
- #Tab:: Send ! {Down}{Down}{Down}{Enter}!{Tab}
-
- ; Поднимаемся на директорию вверх щелчком средней кнопкой мыши в проводнике
- ~MButton::
- MouseGetPos,,,,hovercontrol
- if hovercontrol = SysListView321
- Send {Backspace}
- else if hovercontrol = #327701
- Send {Backspace}
- Return
-
- ; Изменяем вид папок в проводнике с помощью Win+цифровые клавиши
- #1::PostMessage, 0x111, 28717,,, ahk_class CabinetWClass ; Эскизы
- #2::PostMessage, 0x111, 28718,,, ahk_class CabinetWClass ; Крупные значки
- #3::PostMessage, 0x111, 28715,,, ahk_class CabinetWClass ; Список
-
- ; control win F2 copy filename from Explorer
- ^#F2:: Send {F2}^{vk41}^{vk43}{Esc}
-
-
- ; hotstrings
- ::habrs::
- SendInput site:habrahabr.ru
- return
- ::wikir::
- SendInput ru.wikipedia.org/wiki/
- return
- ::wikie::
- SendInput en.wikipedia.org/wiki/
- return
- ::wikis::
- SendInput site:ru.wikipedia.org OR site:en.wikipedia.org
- return
- ::lurks::
- SendInput site:lurkmore.to
- return
- ::ons::
- SendInput site:opennet.ru
- return
- ::sfs::
- SendInput site:sourceforge.net
- return
- ::sos::
- SendInput site:stackoverflow.com
- return
- ::sis::
- SendInput site:samlib.ru
- return
- ::ecs::
- SendInput site:lib.rus.ec
- return
- ::tors::
- SendInput site:nnm-club.ru OR site:rutracker.org OR site:rutor.org
- return
- ::mmnts::
- SendInput site:mmnt.net
- return
- ::mp3s::
- Send myfreemp3.eu
- return
- ::dics::
- Send wordreference.com/enru/
- return
- ::uah::
- ::гфр::
- switch_ru()
- Send цена грн{space}
- switch_en()
- return
-
-
- ; ^RButton - copy link in browser Копировать ссылку shift-F10 ы
- ^RButton::
- switch_ru()
- Send {RButton}{RButton Up}ы
- switch_en()
- return
-
- ; ^+RButton - save image as in browser shift-F10 о
- ^+RButton::
- switch_ru()
- Send {RButton}{RButton Up}о
- switch_en()
- return
-
- #NumpadAdd::
- SoundSet +5
- SoundBeep, 7000, 70
- return
- #NumpadSub::
- SoundSet -5
- SoundBeep, 7000, 70
- return
-
- ; Next song in player
- Numpad6::
- NumpadRight::
- WinGet, ProcessName, ProcessName, A
- if WinExist("ahk_class QWidget")
- WinActivate ; use the window found above
- Send {F8}{F8Up}
- ;MsgBox, Класс активного окна "%class%" ProcessName is "%ProcessName%"
- if ProcessName != "clementine.exe"
- {
- Send {AltDown}{Tab}{TabUp}{AltUp}
- }
- return
-
- Numpad0::
- NumpadIns::
- ;Send {AltDown}{Tab}{TabUp}{AltUp}
- Send {AltDown}{ShiftDown}{Tab}{TabUp}{ShiftUp}{AltUp}
- return
-
- ; Win + S -- samlib.ru/* save in format author,title.html
- #s::
- ;Send ^l^c{Tab}{Tab}
- Send ^{vk4c}^{vk43}{Tab}{Tab}
- ClipWait, 2
- str:=clipboard
- ;end := SubStr(str, InStr(str, "/", false, 0)+1 )
- ;MsgBox, clipboard = %clipboard% str = %str% r=%result%
- RegExMatch(str, ".*/(.*)/(.*)$", result)
- clipboard = %result1%,%result2%
- ;Send ^s^v
- Send ^{vk53}^{vk56}
- return
-
- ; ctrl shift w - close current Tab in firefox ond NewTab
- ^+w::
- ;Send ^t^{PgUP}^w
- Send ^{vk54}^{PgUp}^{vk57}
- return
-
- ; Win+Shift+C скопировать полный путь файла из проводника
- #+c::
- clipboard =
- Send, ^c
- ClipWait, 2
- Sort, clipboard
- return
-
- ^+LButton:: ; control shift + Click open link in new tab and return to current
- WinGet, ProcessName, ProcessName, A
- if ( ProcessName = "firefox.exe" )
- {
- Send ^{LButton}
- sleep 200
- Send ^{PgUp}
- }
- return
-
- ; ctrl t - on Windows Desktop run terminal cmd.exe and work in other programs (~)
- ~^t::
- WinGet, ProcessName, ProcessName, A
- if ( ProcessName = "firefox.exe" )
- ; switch keyboard to en in new tab
- switch_en()
- if ( ProcessName = "explorer.exe" )
- Run "C:\Documents and Settings\Администратор\Рабочий стол\Программы\1Desktop Shortcuts\dev.lnk"
- return
-
- ; set english keyboard layout if new page in browser
- ~^n::
- WinGet, ProcessName, ProcessName, A
- if ( ProcessName = "explorer.exe" )
- Run "C:\Program Files\Notepad++\notepad++.exe"
- return
- ~^w::
- WinGet, ProcessName, ProcessName, A
- if ( ProcessName = "firefox.exe" )
- silent_en()
- return
-
- ; control+shift+Alt+L -- copy URL from current tab to clipboard
- ^+!l::
- Send ^{vk4c}^{vk43}{Tab}{Tab}
- return
-
- ; control+shift+L -- copy URL from current tab to clipboard
- ~^+l::
- WinGet, ProcessName, ProcessName, A
- if ( ProcessName = "firefox.exe" )
- Send ^{vk4c}^{vk43}{Tab}{Tab}
- silent_en()
- str:=clipboard
- if ( RegExMatch(str, "(http://)?(www.)?(.*)$", result) )
- {
- clipboard = %result3%
- }
- return
-
- ; control+shift+J -- menu Jornal Closed Tabs (with Alt not working)
- ^+j::
- WinGet, ProcessName, ProcessName, A
- if ( ProcessName = "firefox.exe" )
- switch_ru()
- Send !{vkBA}{Home}{Down}{Down}{Down}{Down}{Down}{Right} ; alt-ж
- silent_en()
-
- ; alt-C open menu ScrapBook alt-K search in ScrapBook
- ; Send !{vk43}{left}{left}{Home}{Down}{Down}{Down}{Down}{Down}{Right}
- return
-
- ; control win shift + C -- get Cache of current page from Google
- ^#+c::
- ;Send ^l^c{Tab}{Tab}
- Send ^{vk4c}^{vk43}{Tab}{Tab}
- silent_en()
- Send ^tg cache:^v{Enter}
- return
-
- ~^#t::
- Run "C:\Documents and Settings\Администратор\Главное меню\Программы\Стандартные\Командная строка.lnk"
- return
- #^+t::
- Run "C:\Documents and Settings\Администратор\Application Data\Microsoft\Internet Explorer\Quick Launch\books.lnk"
- return
- ~^#v::
- Run "C:\WINDOWS\system32\sndvol32.exe"
- sleep 300
- Send {tab}
- return
- ~^#a::
- Run "C:\Documents and Settings\Администратор\Application Data\Microsoft\Internet Explorer\Quick Launch\Ярлык для Far.exe.lnk"
- return
- ^#f::
- Run "C:\Documents and Settings\Администратор\Application Data\Microsoft\Internet Explorer\Quick Launch\Mozilla Firefox.lnk"
- return
- ~^#n::
- Run "C:\Documents and Settings\Администратор\Application Data\Microsoft\Internet Explorer\Quick Launch\Notepad++.lnk"
- return
- ~^#c::
- Run "C:\Documents and Settings\Администратор\Application Data\Microsoft\Internet Explorer\Quick Launch\Clementine.lnk"
- return
- ~^#i::
- Run "C:\Documents and Settings\Администратор\Application Data\Microsoft\Internet Explorer\Quick Launch\ICE Book Reader.lnk"
- return
- ~^#z::
- Run "C:\Загрузки"
- return
-
- ^#+e::
- Send ^t
- sleep 1000
- Send wordreference.com/enru/
- switch_en()
- return
- ^#+r::
- Send ^t
- sleep 1000
- Send wordreference.com/ruen/
- switch_ru()
- return
-
- ^#+y::
- Send ^t
- sleep 1000
- Send translate.yandex.ru{Enter}
- sleep 2000
- Send {Tab}
- return
-
- ; Alt F4 -- close cmd.exe
- #IfWinActive, ahk_class ConsoleWindowClass
- !F4::WinClose, A
- #IfWinActive
-
- ; ^c vk43 ^v vk56 ^x vk58 ^l vk4c ^s vk53 ^a vk41 {enter} vk0d