/AutoHotkey.ahk

https://bitbucket.org/micedir/config · AutoHotKey · 357 lines · 265 code · 41 blank · 51 comment · 16 complexity · e0c087dd21b50295d681a6c62f34eae9 MD5 · raw file

  1. ; AutoHotKey.ahk (c) micedir
  2. ; version 0.1.5.4
  3. ; This script has a special filename and path because it is automatically
  4. ; launched when you run the program directly. Also, any text file whose
  5. ; name ends in .ahk is associated with the program, which means that it
  6. ; can be launched simply by double-clicking it. You can have as many .ahk
  7. ; files as you want, located in any folder. You can also run more than
  8. ; one ahk file simultaneously and each will get its own tray icon.
  9. ; Note: From now on whenever you run AutoHotkey directly, this script
  10. ; will be loaded.
  11. #SingleInstance force
  12. silent_en()
  13. {
  14. PostMessage, 0x50, 0, 0x4090409,, A; switch keyboard to default english layout
  15. }
  16. ; Menu key minimize the active window
  17. AppsKey::
  18. silent_en()
  19. WinGetActiveTitle, Title
  20. WinGetClass, class, A
  21. if ( class = "QWidget" ) ; Title = "Clementine" or filename
  22. {
  23. WinGet, ProcessName, ProcessName, A
  24. ;MsgBox, The active window is "%Title%" Класс активного окна "%class%" ProcessName is "%ProcessName%"
  25. if ( ProcessName = "clementine.exe" )
  26. {
  27. WinMinimize,A
  28. ;WinClose, A
  29. }
  30. else
  31. Send ! {Down}{Down}{Down}{Enter}
  32. }
  33. else
  34. {
  35. Send ! {Down}{Down}{Down}{Enter}
  36. }
  37. return
  38. ^+AppsKey::
  39. WinGetActiveTitle, Title
  40. WinGetClass, class, A
  41. WinGet, ProcessName, ProcessName, A
  42. MsgBox, The active window is "%Title%" Класс активного окна "%class%" ProcessName is "%ProcessName%"
  43. return
  44. ; Alt-F9 свернуть активное окно
  45. !F9:: Send ! {Down}{Down}{Down}{Enter}
  46. ^F9:: Send ! {Down}{Down}{Down}{Enter}
  47. #F9:: Send #d+!{Tab}
  48. ; Win + up/down Window as in Windows7
  49. #Up:: WinMaximize A ; need dowbleClick on WindowTitle for cycle /WinRestore
  50. #Down:: Send ! {Down}{Down}{Down}{Enter}
  51. ^F10:: Send !{Tab}! {Down}{Down}{Down}{Enter}
  52. !F10:: WinMaximize A
  53. !+F10:: WinRestore A
  54. ; http://forum.script-coding.com/viewtopic.php?pid=63656
  55. switch_en()
  56. {
  57. ; переключение активного окна в английскую раскладку
  58. PostMessage, 0x50, 0, 0x4090409,, A
  59. SoundBeep, 5000, 30 ; для полного выключения звука закомментируйте
  60. }
  61. switch_ru()
  62. {
  63. ; переключение активного окна в русскую раскладку
  64. PostMessage, 0x50, 0, 0x4190419,, A
  65. SoundBeep, 200, 30 ; для полного выключения звука закомментируйте
  66. }
  67. ; переключаем активное окно в английскую раскладку по нажатию клавиши:
  68. RAlt:: switch_en()
  69. ; переключаем активное окно в русскую раскладку по нажатию клавиши:
  70. RWin:: switch_ru()
  71. ; Win+P Пуск -> Все программы
  72. #p:: Send ^{Esc}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Enter}
  73. ; Win+Ctrl+P Панель Управления
  74. #^p:: Send ^{Esc}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Enter}! {Down}{Down}{Down}{Enter}
  75. #Tab:: Send ! {Down}{Down}{Down}{Enter}!{Tab}
  76. ; Поднимаемся на директорию вверх щелчком средней кнопкой мыши в проводнике
  77. ~MButton::
  78. MouseGetPos,,,,hovercontrol
  79. if hovercontrol = SysListView321
  80. Send {Backspace}
  81. else if hovercontrol = #327701
  82. Send {Backspace}
  83. Return
  84. ; Изменяем вид папок в проводнике с помощью Win+цифровые клавиши
  85. #1::PostMessage, 0x111, 28717,,, ahk_class CabinetWClass ; Эскизы
  86. #2::PostMessage, 0x111, 28718,,, ahk_class CabinetWClass ; Крупные значки
  87. #3::PostMessage, 0x111, 28715,,, ahk_class CabinetWClass ; Список
  88. ; control win F2 copy filename from Explorer
  89. ^#F2:: Send {F2}^{vk41}^{vk43}{Esc}
  90. ; hotstrings
  91. ::habrs::
  92. SendInput site:habrahabr.ru
  93. return
  94. ::wikir::
  95. SendInput ru.wikipedia.org/wiki/
  96. return
  97. ::wikie::
  98. SendInput en.wikipedia.org/wiki/
  99. return
  100. ::wikis::
  101. SendInput site:ru.wikipedia.org OR site:en.wikipedia.org
  102. return
  103. ::lurks::
  104. SendInput site:lurkmore.to
  105. return
  106. ::ons::
  107. SendInput site:opennet.ru
  108. return
  109. ::sfs::
  110. SendInput site:sourceforge.net
  111. return
  112. ::sos::
  113. SendInput site:stackoverflow.com
  114. return
  115. ::sis::
  116. SendInput site:samlib.ru
  117. return
  118. ::ecs::
  119. SendInput site:lib.rus.ec
  120. return
  121. ::tors::
  122. SendInput site:nnm-club.ru OR site:rutracker.org OR site:rutor.org
  123. return
  124. ::mmnts::
  125. SendInput site:mmnt.net
  126. return
  127. ::mp3s::
  128. Send myfreemp3.eu
  129. return
  130. ::dics::
  131. Send wordreference.com/enru/
  132. return
  133. ::uah::
  134. ::гфр::
  135. switch_ru()
  136. Send цена грн{space}
  137. switch_en()
  138. return
  139. ; ^RButton - copy link in browser Копировать ссылку shift-F10 ы
  140. ^RButton::
  141. switch_ru()
  142. Send {RButton}{RButton Up}ы
  143. switch_en()
  144. return
  145. ; ^+RButton - save image as in browser shift-F10 о
  146. ^+RButton::
  147. switch_ru()
  148. Send {RButton}{RButton Up}о
  149. switch_en()
  150. return
  151. #NumpadAdd::
  152. SoundSet +5
  153. SoundBeep, 7000, 70
  154. return
  155. #NumpadSub::
  156. SoundSet -5
  157. SoundBeep, 7000, 70
  158. return
  159. ; Next song in player
  160. Numpad6::
  161. NumpadRight::
  162. WinGet, ProcessName, ProcessName, A
  163. if WinExist("ahk_class QWidget")
  164. WinActivate ; use the window found above
  165. Send {F8}{F8Up}
  166. ;MsgBox, Класс активного окна "%class%" ProcessName is "%ProcessName%"
  167. if ProcessName != "clementine.exe"
  168. {
  169. Send {AltDown}{Tab}{TabUp}{AltUp}
  170. }
  171. return
  172. Numpad0::
  173. NumpadIns::
  174. ;Send {AltDown}{Tab}{TabUp}{AltUp}
  175. Send {AltDown}{ShiftDown}{Tab}{TabUp}{ShiftUp}{AltUp}
  176. return
  177. ; Win + S -- samlib.ru/* save in format author,title.html
  178. #s::
  179. ;Send ^l^c{Tab}{Tab}
  180. Send ^{vk4c}^{vk43}{Tab}{Tab}
  181. ClipWait, 2
  182. str:=clipboard
  183. ;end := SubStr(str, InStr(str, "/", false, 0)+1 )
  184. ;MsgBox, clipboard = %clipboard% str = %str% r=%result%
  185. RegExMatch(str, ".*/(.*)/(.*)$", result)
  186. clipboard = %result1%,%result2%
  187. ;Send ^s^v
  188. Send ^{vk53}^{vk56}
  189. return
  190. ; ctrl shift w - close current Tab in firefox ond NewTab
  191. ^+w::
  192. ;Send ^t^{PgUP}^w
  193. Send ^{vk54}^{PgUp}^{vk57}
  194. return
  195. ; Win+Shift+C скопировать полный путь файла из проводника
  196. #+c::
  197. clipboard =
  198. Send, ^c
  199. ClipWait, 2
  200. Sort, clipboard
  201. return
  202. ^+LButton:: ; control shift + Click open link in new tab and return to current
  203. WinGet, ProcessName, ProcessName, A
  204. if ( ProcessName = "firefox.exe" )
  205. {
  206. Send ^{LButton}
  207. sleep 200
  208. Send ^{PgUp}
  209. }
  210. return
  211. ; ctrl t - on Windows Desktop run terminal cmd.exe and work in other programs (~)
  212. ~^t::
  213. WinGet, ProcessName, ProcessName, A
  214. if ( ProcessName = "firefox.exe" )
  215. ; switch keyboard to en in new tab
  216. switch_en()
  217. if ( ProcessName = "explorer.exe" )
  218. Run "C:\Documents and Settings\Администратор\Рабочий стол\Программы\1Desktop Shortcuts\dev.lnk"
  219. return
  220. ; set english keyboard layout if new page in browser
  221. ~^n::
  222. WinGet, ProcessName, ProcessName, A
  223. if ( ProcessName = "explorer.exe" )
  224. Run "C:\Program Files\Notepad++\notepad++.exe"
  225. return
  226. ~^w::
  227. WinGet, ProcessName, ProcessName, A
  228. if ( ProcessName = "firefox.exe" )
  229. silent_en()
  230. return
  231. ; control+shift+Alt+L -- copy URL from current tab to clipboard
  232. ^+!l::
  233. Send ^{vk4c}^{vk43}{Tab}{Tab}
  234. return
  235. ; control+shift+L -- copy URL from current tab to clipboard
  236. ~^+l::
  237. WinGet, ProcessName, ProcessName, A
  238. if ( ProcessName = "firefox.exe" )
  239. Send ^{vk4c}^{vk43}{Tab}{Tab}
  240. silent_en()
  241. str:=clipboard
  242. if ( RegExMatch(str, "(http://)?(www.)?(.*)$", result) )
  243. {
  244. clipboard = %result3%
  245. }
  246. return
  247. ; control+shift+J -- menu Jornal Closed Tabs (with Alt not working)
  248. ^+j::
  249. WinGet, ProcessName, ProcessName, A
  250. if ( ProcessName = "firefox.exe" )
  251. switch_ru()
  252. Send !{vkBA}{Home}{Down}{Down}{Down}{Down}{Down}{Right} ; alt-ж
  253. silent_en()
  254. ; alt-C open menu ScrapBook alt-K search in ScrapBook
  255. ; Send !{vk43}{left}{left}{Home}{Down}{Down}{Down}{Down}{Down}{Right}
  256. return
  257. ; control win shift + C -- get Cache of current page from Google
  258. ^#+c::
  259. ;Send ^l^c{Tab}{Tab}
  260. Send ^{vk4c}^{vk43}{Tab}{Tab}
  261. silent_en()
  262. Send ^tg cache:^v{Enter}
  263. return
  264. ~^#t::
  265. Run "C:\Documents and Settings\Администратор\Главное меню\Программы\Стандартные\Командная строка.lnk"
  266. return
  267. #^+t::
  268. Run "C:\Documents and Settings\Администратор\Application Data\Microsoft\Internet Explorer\Quick Launch\books.lnk"
  269. return
  270. ~^#v::
  271. Run "C:\WINDOWS\system32\sndvol32.exe"
  272. sleep 300
  273. Send {tab}
  274. return
  275. ~^#a::
  276. Run "C:\Documents and Settings\Администратор\Application Data\Microsoft\Internet Explorer\Quick Launch\Ярлык для Far.exe.lnk"
  277. return
  278. ^#f::
  279. Run "C:\Documents and Settings\Администратор\Application Data\Microsoft\Internet Explorer\Quick Launch\Mozilla Firefox.lnk"
  280. return
  281. ~^#n::
  282. Run "C:\Documents and Settings\Администратор\Application Data\Microsoft\Internet Explorer\Quick Launch\Notepad++.lnk"
  283. return
  284. ~^#c::
  285. Run "C:\Documents and Settings\Администратор\Application Data\Microsoft\Internet Explorer\Quick Launch\Clementine.lnk"
  286. return
  287. ~^#i::
  288. Run "C:\Documents and Settings\Администратор\Application Data\Microsoft\Internet Explorer\Quick Launch\ICE Book Reader.lnk"
  289. return
  290. ~^#z::
  291. Run "C:\Загрузки"
  292. return
  293. ^#+e::
  294. Send ^t
  295. sleep 1000
  296. Send wordreference.com/enru/
  297. switch_en()
  298. return
  299. ^#+r::
  300. Send ^t
  301. sleep 1000
  302. Send wordreference.com/ruen/
  303. switch_ru()
  304. return
  305. ^#+y::
  306. Send ^t
  307. sleep 1000
  308. Send translate.yandex.ru{Enter}
  309. sleep 2000
  310. Send {Tab}
  311. return
  312. ; Alt F4 -- close cmd.exe
  313. #IfWinActive, ahk_class ConsoleWindowClass
  314. !F4::WinClose, A
  315. #IfWinActive
  316. ; ^c vk43 ^v vk56 ^x vk58 ^l vk4c ^s vk53 ^a vk41 {enter} vk0d